R – Destroy a movie Clip and everything in it

actionscript-3flash

I am making a game with flash as3. I create a movieclip that contains all of the games content within it. I pretty much encapsulated the game within this one movie clip. after the game is over I remove the movieclip off the screen. but yet, all the other movieclips within the main movieclip still keep playing.

I could create a deconstructor that removes all the items. but that seems like much to do. is there something easier ?

I tried making the movieclip null. but all the other movieclips Timers keep going off still and causes errors to go off.

Best Answer

myButton.addEventListener(MouseEvent.CLICK,myButton_Clicked);
...
function myButton_Clicked(event:MouseEvent)
{
    this.removeChild(this.getChildByName("myMovieClip"))
}

try this!!!

Related Topic