I am currently working on a project where I create explosions on the screen by adding the movieclip symbol explosion to the main timeline via:
addChild(explosion);
I am trying to figure out how to dynamically remove the explosion (make it eligible for garbage collection) when it is done playing the animation of the explosion.
I have tried parent.removeChild(this) within the symbol itself and that throws an error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
Is there any way to have a movieclip remove itself? If not is there a way to call a function in the actionscript code explosion exports to? Or maybe there is a way to call a function in the main timeline? Any help would be much appreciated!!