views:

29

answers:

0

i want to deallocate a spriteClass from memory and remove it from the display list.

when the spriteClass is instantiated, it creates some of it's own sprites with new tweens and tween events and add them as children. i understand that the tween events must be removed in order for the spritClass to become available for garbage collection, and only afterwards should i remove and nullify the spriteClass, but should i also nullify and remove the spriteClass's sprite children and tweens as well, or does it not matter?

essentially i'd like to know if by writing

spriteClass.deallocate(); //removes it's tween event listeners;
removeChild(spriteClass);
spriteClass = null; 

it automatically removes all of it's added children and new instantiations like tweens, sprites, rects, whatever, or am i responsible for removing them all along with event listeners from within my spriteClass.deallocate() function?