I'm working on a program in Flash coded in Actionscript 3 and I'm trying to determine if I should remove MovieClips from the stage when they're not on screen, or just stop moving them once they're outside the viewing area. If I do not removeChild() the MovieClips once they move out of the viewing area, I can potentially end up with tens of thousands of MovieClips on the stage (though not in view).
Is there a standard recommendation for hiding vs. removing MovieClips when not in view?
Basically, I'm trying to find out:
- Does having MovieClips on the stage but outside of the viewing area use a lot of resources?
- How much of a penalty does removing and adding MovieClips to and from the stage incur?
- Is there an estimate of how many MovieClips you are working with before you should switch from one method to the other?
Thanks!
--EDIT-- In my program, MovieClips will often have to reappear on the screen. This means that when I remove them from the stage, they might have to be added back. If I hide them off-screen, they might have to be moved back on-screen. This is why I don't just removeChild() everything and null out the object.
mc.visible = false- Pier