How do access all of the children of a DisplayObject using code? (I'm looking for something like movieclip.children
)
I'm using this in two cases:
1) To loop through and reposition all of the children of an enclosing MovieClip.
Or
2) To loop through and delete all of the children of a MovieClip
Also, this is a Flash CS5 project.
This loop will touch every child inside movieclip foo. I'm not sure what you're going to do to them, but you can run whatever methods you need inside the loop.
for (var i:uint=0; i<foo.numChildren;i++){
foo.getChildAt(i).whateverMethodYouNeed();
}