flash - How can I re-order the children of my container in AS3 -



flash - How can I re-order the children of my container in AS3 -

i have little problem in managing children container. fact has lot of children , y coordinates random.

is there anyway can order them y coordinates lower in front end , higher in back?

is that can 2 "for"?

thank help ^^

//the number of elements in our component var count:int = numelements; var elements:array = []; //load elements of component array (var i:int=0; i<count; i++) { elements[i] = getelementat(i); } //sort array elements based on 'y' property elements.sorton("y", array.numeric); //re-add element component //in order of sorted array created. //when add together element using 'addelement' //be added @ top of component's displaylist //and automatically removed original position. (i=0; i<count; i++) { addelement(elements[i]); }

this spark components. can exact same thing mx components using getchildat() , addchild() instead of getelementat() , addelement()

flash actionscript-3 programming-languages

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -