NEU: Alle Visual Codes als Code Snippets für Flash CS5:
jetzt hier downloaden .

Duplizieren, Skalieren und Rotieren

Code Actionscript 2.0

Frame-Aktion

for (i = 1; i < 80; i = i + 1) {
square0.duplicateMovieClip("square" + i, i);
this["square" + i]._rotation = 1.25 * i;
this["square" + i]._xscale = 40 * i;
this["square" + i]._yscale = 40 * i;
}
square0._visible = false;

Code Actionscript 3.0

var Squares:Array = new Array(); var i = 1; for (i=1; i<80; i = i + 1) { //important: square has to be exported for actionscript //go to "linkage" in library menu Squares[i] = new squareObject(); Squares[i].x = square0.x; Squares[i].y = square0.y; Squares[i].rotation=1.25*i; Squares[i].scaleX= 0.4*i; Squares[i].scaleY= 0.4*i; addChild(Squares[i]); } square0.visible=false;

Infos

Das kleine Quadrat square0 wird 79 Mal kopiert. Beim Kopieren werden die Eigenschaften Rotation und Skalierung xscale, yscale kontinuierlich verändert. Die jeweilige Veränderung wird aus der Schleifenvariablen i berechnet.

Download

Right click: Flashfile AS 2.0 | Flashfile AS 3.0 | SWF-File


Share