Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 24-08-2003, 20:28   #1 (permalink)
Revived @ Sunday
 
Benutzerbild von MacEvil
 
Registriert seit: Apr 2003
Ort: Nowhereland
Beiträge: 3.244
moveTo(_root.array[variable],_root.array2[variable]);

N'abend,
Ärger mich nun schon über ne Stunde darüber warum es nicht geht.
Ich will nen MoveTo mit Koordinaten über ein Array.Aber ich schreib im MoveTo selber als x Koor. nicht Array[0] oder so,sondern anstatt eine Zahl,eine Variable die eine dynamische Zahl beeinhaltet :
ActionScript:
  1. _root.onMouseDown = function () {
  2. dievar++;
  3. }
  4. _root.onEnterFrame = function () {
  5. mc.lineTo(_root.arrayA[dievar], _root.arrayB[dievar]);
  6. }
Wenn ich dann trace(_root.arrayA[dievar]);
schreibe, gibt es undefined aus !
warum geht das nicht ?

verzweifel,
MacEvil
MacEvil ist offline   Mit Zitat antworten
Alt 24-08-2003, 20:31   #2 (permalink)
...
 
Registriert seit: Oct 2002
Ort: Nürnberg
Beiträge: 3.611
wie sieht denn dein array aus?
(definition, refernzierung etc.)
thorben.schmitt ist offline   Mit Zitat antworten
Alt 24-08-2003, 20:33   #3 (permalink)
Revived @ Sunday
 
Benutzerbild von MacEvil
 
Registriert seit: Apr 2003
Ort: Nowhereland
Beiträge: 3.244
Es speichert vom User eingegebene Koordinaten also :
ActionScript:
  1. _root.koordinatenarray.push(_root.eingeabetextfeld);
MacEvil ist offline   Mit Zitat antworten
Alt 24-08-2003, 20:35   #4 (permalink)
...
 
Registriert seit: Oct 2002
Ort: Nürnberg
Beiträge: 3.611
ich meine arrayA/arrayB
thorben.schmitt ist offline   Mit Zitat antworten
Alt 24-08-2003, 20:38   #5 (permalink)
Revived @ Sunday
 
Benutzerbild von MacEvil
 
Registriert seit: Apr 2003
Ort: Nowhereland
Beiträge: 3.244
Ja,das mein ich auch,hab nur nen examples arraynamen genommen.
(Mein Projekt nicht gerade hier veröffentlichen will )
MacEvil ist offline   Mit Zitat antworten
Alt 24-08-2003, 20:41   #6 (permalink)
...
 
Registriert seit: Oct 2002
Ort: Nürnberg
Beiträge: 3.611
musst ja nicht dein komplettes projekt, sonder nur einen code-auschnitt "veroeffentlichen", sond wird problematisch.
Check mal deine referenzierung.
ActionScript:
  1. xArr = [32, 234, 123, 56, 43, 34, 24, 26, 102];
  2. YArr = [42, 234, 12, 46, 43, 95, 190, 92, 9];
  3. var o = this.createEmptyMovieClip("dummy", 1);
  4. o.onEnterFrame = function() {
  5.     this.clear();
  6.     this.lineStyle(0), this.lineTo(xArr[wert], yArr[wert]);
  7.     wert>xArr.length ? trace("array zu ende") : null;
  8. };
  9. this.onMouseDown = function() {
  10.     wert++;
  11. };
thorben.schmitt ist offline   Mit Zitat antworten
Alt 24-08-2003, 20:42   #7 (permalink)
Revived @ Sunday
 
Benutzerbild von MacEvil
 
Registriert seit: Apr 2003
Ort: Nowhereland
Beiträge: 3.244
ActionScript:
  1. _root.xmark = [];
  2. _root.ymark = [];
  3. aktuell = 0;
  4. _root.onMouseDown = function() {
  5.     if (_root.feld.hitTest(_root._xmouse, _root._ymouse, true)) {
  6.         aktuell++;
  7.         _root.xmark.push(_root._xmouse);
  8.         _root.ymark.push(_root._ymouse);
  9.         _root.createEmptyMovieClip("lol", 1);
  10.     }
  11. };
  12. _root.onEnterFrame = function() {
  13.     lol.lineStyle(2, 0x000000, 90);
  14.     if (_root.line == 0 || _root.move == 0) {
  15.         _root.l = "line : "+_root.line;
  16.         _root.m = "move : "+_root.move;
  17.     }
  18.     _root.x = _root.xmark;
  19.     _root.y = _root.ymark;
  20.     if (_root.move == 1) {
  21.         lol.moveTo(_root.xmark[aktuell], _root.ymark[aktuell]);
  22.     } else {
  23.         lol.lineTo(_root.xmark[aktuell], _root.ymark[aktuell]);
  24.     }
  25.     };
  26. _root.clear.onRelease = function() {
  27.     _root.xmark = new Array();
  28.     _root.ymark = new Array();
  29. };
MacEvil ist offline   Mit Zitat antworten
Antwort

Lesezeichen

Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks sind an
Pingbacks sind an
Refbacks sind an



Alle Zeitangaben in WEZ +1. Es ist jetzt 23:34 Uhr.

Domains, Webhosting & Vserver von Host Europe
Unterstützt das Flashforum!
Adobe User Group


Copyright ©1999 – 2012 Marc Thiele