/ Published in: ActionScript 3
DisplayObjectContainer, a parent class of the more common container classes such as MovieClip and Sprite, does not have a built in method to immediately remove all children. To remove all children we simply use a while loop to remove the child which occupies index 0 in the stack until no children remain.
Expand |
Embed | Plain Text
while (displayObjectContainer.numChildren) { displayObjectContainer.removeChildAt(0); }
You need to login to post a comment.
