Want to clear contents of stage in actionscript 3

actionscript-3flash

I am new to flash and actionscript.
I have added some movie clips to the stage using addChild method on Some Mouse Events.

Now on an event say Mouse Double Click I want to clean the stage.

I checked the Stage class from reference it does not have any method called clear.
Neither I have stored the references of the objects, so that i can clear them using removeChild()

How to go about?

Best Answer

I would recommend keeping the references of the objects in an array.

Barring that, you could do this (off the top of my head):

while(numChildren > 0) {
    removeChildAt(0);
}
Related Topic