views:

34

answers:

1

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?

+3  A: 

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);
}
Chris Burt-Brown
Depending on the location of this code, you may need to prepend stage. to numChildren and removeChildAt. +1
Tegeril