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
Post a Comment