1
votes

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?

2

2 Answers

4
votes

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);
}
0
votes
if( numChildren )
{
    removeAllChildren();
}