views:

60

answers:

2

hello! im just trying to delete forever a mc. i create a mc and then i make an addChild of a sprite.

var mcSwap1:MovieClip = new MovieClip();
addChild(mcSwap1);
mcSwap1.addChild(mySprite);

if i want to delete from everywhere and forever mcSwap1, what can i do?

removeChild(mcSwap1);
mcSwap1=null;

doesn't work very well...the memory is not really free!

thanks a lot in advance :)

+1  A: 

What you're doing there is the best you can do, remember you could maybe remove mySprite from mcSwap1 too. Also remember to remove any event listeners etc

WillDonohoe
A: 

Check this similar question (and answers):

How to completely remove a movieclip in AS3

Makram Saleh