actionscript 3 - how to call objects created in a loop? -


newbie question:

if create several shape objects in loop, like:

var i:int;  (i = 0; < 3; i++) {     var circle:shape = new shape();     circle.graphics.beginfill(color);     circle.graphics.drawcircle(100,100, radius);     circle.graphics.endfill();     addchild(circle);    } 

how can call different shapes separately, manipulate properties? seem me have same name?

you can access them via index (the order have been put on stage). like:

displayobject(getchildat(1)).x = 100; // 1 index (starting @ 0) 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -