Slightly modified grid

Code Actionscript 2.0

Frame action

i = 1;
for (gx = 0; gx <= 8; gx = gx + 1) {
for (gy = 0; gy <= 8; gy = gy + 1) {
i = i + 1;
square0.duplicateMovieClip("square" + i, i);
this["square" + i]._x = gx * 50;
this["square" + i]._y = gy * 50;
this["square" + i]._xscale = 50 + random(100);
}
}
square0._visible = 0;

Code Actionscript 3.0

var Squares:Array = new Array(); var i = 1; for (var gx = 0; gx < 8; gx = gx + 1) { for (var gy = 0; gy < 8; gy = gy + 1) { i = i+1; //important: square has to be exported for actionscript //go to "linkage" in library menu Squares[i] = new squareObject(); Squares[i].alpha = square0.alpha; Squares[i].x = gx * 50; Squares[i].y = gy * 50; Squares[i].scaleX = 0.5 + Math.random(); addChild(Squares[i]); } } square0.visible = false;

Description

A basic element is arranged into an 8x8 grid structure. Using the random-function, each instance is assigned a different width between 50 and 150.

related to: Grid arrangement

Download

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


Share