addChild Crashing iPad3 [HELP]
I have an application that has 8 buttons on an interface. Each button loads a movie clip from the library. The way I'm doing it now .. is I am putting 8 variables when the app load up. var movieclip1; When the user clicks on a button I am doing the MovieClip = new MovieClip(); method .. when the user exits that section I am setting the movie clip to null and removing it. I am finding though that I am having some memory problems on the iPad3 doing it this way. Is there a better way I could be doing this ? Id like it so when you aren't in a loaded section .. there is nothing at all in the memory for that section. What I'm doing now is ... if you click on Button1 and load up movieclip1 ... and then you click button 2... it will check if any of the 8 movieclips are loaded... if they are .. they are removed and set to null However the dilemma I face... is that tweening always performs sluggish the first time around if that movie clip hasn't been previously added to the stage. Once it performs the tween once .. then its fine. I'm hoping there is a better way to handle these movie clips. Another question i have... one of the movieclips has 48 seperate MouseEvent listeners. ... when I remove and NULL the movieclip ... do I need to manually remove each mouse event listener ? I've read that listeners dont get destroyed. Could it be these listeners that are building up and causing the crashing on the iPad3 ? It doesnt crash on iPad2 .. and runs great on the desktop. Trying to optimize this the best way possible. Any help is appreciated. |
