Sprites:: Visible=true/false VS addChild()/removeChild()
Posted on 2007-10-20
In a flash game, there are different sprites that:
a)may not even be in the current level
b)may be in the current level, but not visible
c)may be in the current level and visible
Currently, I resolve (a) and (b) the same way, removeChild();
and when the state changes to (c), addChild();
I was wondering if this is the most efficient way, or if it would be more efficient to simply make the inactive sprites visible=false, and then visible=true rather than constantly adding and removing changes.
add/remove child() Questions:
PRO, releases memory when they are not even there??
CON, high impact on performance when adding/removing than changing visible??
PRO, low impact on performance when changing the visible parameter??
CON, non-visible sprites still exist in memory eating up resources??