Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 05-11-2003, 12:44   #1 (permalink)
*~*~*~*~*~*~*~*
 
Registriert seit: Feb 2002
Ort: Perth, WA
Beiträge: 651
createEmptymovieClip duplizieren?

hallo hallo!
laesst sich ein dyn. erstellter mc nicht duplizieren?!
ich moechte ein obj in die x und y richtng duplizieren, um dann ballX & ballY wieder zu spiegeln ...leider geht der letzte schritt nicht ( ballXCopy..) woran liegt das?...?
ballx /Y wird zwar dupliziert, aber der inhalt nicht..


//1 mc als "ball" in der lib verknuepfen
ActionScript:
  1. //////////////////////////////////////////////
  2. _root.screenWidth=1180;
  3. _root.screenHeight=896;
  4. _root.ballWidth=_root.ballHeight=25;
  5. _root.offset=30;
  6. _root.amountX=int(_root.screenWidth/(_root.ballWidth+_root.offset));
  7. _root.amountY=int(_root.screenHeight/(_root.ballHeight+_root.offset));
  8. //////////////////////////////////////////////
  9.  
  10. //container
  11. this.createEmptyMovieClip("ballX",1);
  12. this.createEmptyMovieClip("ballY",2);
  13.  
  14.             //amountX
  15. for(var i= 1;i<=5;i++)
  16. {
  17.     ballX.attachMovie("ball","ball" +i+"Mc",i);
  18.     ballX["ball" +i+ "Mc"]._x+=i*offset;
  19. }         
  20.           //amountY
  21. for(var i= 1;i<=5;i++)
  22. {
  23.     ballY.attachMovie("ball","ball" +i+"Mc",i);
  24.     ballY["ball" +i+ "Mc"]._y+=i*offset;
  25. }
  26.                                 //die container duplizieren
  27. this.ballX.duplicateMovieClip("ballXCopy",3,{_y:375,_x:75});
  28.                                 //die container duplizieren
  29. this.ballY.duplicateMovieClip("ballYCopy",4,{_x:375,_y:75});
  30. stop();
sina ist offline   Mit Zitat antworten
Alt 05-11-2003, 13:02   #2 (permalink)
*~*~*~*~*~*~*~*
 
Registriert seit: Feb 2002
Ort: Perth, WA
Beiträge: 651
der effekt soll so aussehen:

o o o o o o
o_______o
o _______o
o _______o
o o o o o o



sieht aber nur so aus:

o o o o o o
o
o
o
o

Geändert von sina (05-11-2003 um 13:03 Uhr)
sina ist offline   Mit Zitat antworten
Alt 05-11-2003, 13:19   #3 (permalink)
...
 
Registriert seit: Oct 2002
Ort: Nürnberg
Beiträge: 3.611
warum duplicate?
hab dir mal eine kl. function geschrieben:
ActionScript:
  1. function setIt(mc, numH, numW, target, dist) {
  2.     for (var y = 0; y<numH; y++) {
  3.         for (var x = 0; x<numW; x++) {
  4.             if (!y || !x || y == numH-1 || x == numW-1) {
  5.                 target.attachMovie(mc, "mc", d++, {_x:x*dist, _y:y*dist});
  6.             }
  7.         }
  8.     }
  9. }
  10. setIt("ball", 10, 10, _root, 15);


Geändert von thorben.schmitt (05-11-2003 um 13:22 Uhr)
thorben.schmitt ist offline   Mit Zitat antworten
Alt 05-11-2003, 13:29   #4 (permalink)
*~*~*~*~*~*~*~*
 
Registriert seit: Feb 2002
Ort: Perth, WA
Beiträge: 651
hi thorben!
wunderschoen,
sina 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 01:44 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele