Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 03-03-2004, 21:26   #1 (permalink)
querfeldein
 
Benutzerbild von benemie
 
Registriert seit: Jul 2002
Ort: im Süden
Beiträge: 205
mc's anordnen per attachmovie

nen guten abend, forum

versuche mich gerade an einem script welches
25 MCs in "tabellenform" anornet (attachMovie).

also so-->

[] [] [] [] []
[] [] [] [] []
[] [] [] [] []
[] [] [] [] []
[] [] [] [] []

mein script-->
ActionScript:
  1. anzahl = 25;
  2. abstand = 12;
  3. anzahlreihe = 5;
  4. _root.createEmptyMovieClip("positioner", 1);
  5. with (_root.positioner) {
  6.     xpos = new Array(anzahl);
  7.     ypos = new Array(anzahl);
  8.     for (i=1; i<=anzahl; i++) {
  9.         if (i>anzahlreihe) {
  10.             xpos[i] = xpos[i-5];
  11.             ypos[i] = xpos[i-5]+abstand;
  12.         } else {
  13.             xpos[i] = i*abstand;
  14.             ypos[i] = 0;
  15.         }
  16.         _root.positioner.attachMovie("quad", "q"+i, i+23, {_x:xpos[i], _y:ypos[i]});
  17.     }
  18. }

was ist da falsch im busch?
__________________
mfg b

angst vor palmen !!!
benemie ist offline   Mit Zitat antworten
Alt 03-03-2004, 21:30   #2 (permalink)
mod_rewrite
 
Benutzerbild von sonar
 
Registriert seit: Feb 2003
Ort: München
Beiträge: 15.621
Du hast in deinem Array nix drin.
Wenn du ein Array so erstellst:
var xy = new Array(25);
kriegst ein Array, welches einfach 25 leere Elemente enthält.

Ich würd sowas mit rustys Modulo-Tut machen:
Tut's die keiner braucht! *modulo*
__________________
RTFM
Wie man Fragen richtig stellt.

Achim Bindannmalweg

Money makes the world go round, fear makes it turn much faster.
(New Model Army)
sonar ist offline   Mit Zitat antworten
Alt 04-03-2004, 09:59   #3 (permalink)
querfeldein
 
Benutzerbild von benemie
 
Registriert seit: Jul 2002
Ort: im Süden
Beiträge: 205
cool

danke, habe sowas wie modulo gesucht, dachte das gibts nur in director.
__________________
mfg b

angst vor palmen !!!
benemie ist offline   Mit Zitat antworten
Alt 04-03-2004, 10:09   #4 (permalink)
querfeldein
 
Benutzerbild von benemie
 
Registriert seit: Jul 2002
Ort: im Süden
Beiträge: 205
übrigens

der array funktioniet schon, es wird eine Zahl erzeugt, die dann eine zeile weiter ausgelesen wird.

ActionScript:
  1. anzahl = 25;
  2. abstand = 12;
  3. anzahlreihe = 5;
  4. xpos = new Array(25);
  5. ypos = new Array(25);
  6. _root.createEmptyMovieClip("positioner", 1);
  7. with (_root.positioner) {
  8.     for (i=1; i<=anzahl; i++) {
  9.         xpos[i] = (i%anzahlreihe)*abstand;
  10.         ypos[i] = Math.floor(i/anzahlreihe)*abstand;
  11.         this.attachMovie("quad", "q"+i, i+23, {_x:xpos[i], _y:ypos[i]});
  12.     }
  13. }
__________________
mfg b

angst vor palmen !!!
benemie 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 22:35 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele