Hi all,
Apologies if i'm asking a ridiculous question, trying something nuts, or completely missing something simple, but i've been going at this for hours with no success and i'm getting a little dis-heartened. The magic of actually loading content in via LoaderMax (i'm a long time Greensock user, but have only stepped into the frustrating world of AS3 and as such have only just realised how great SplitText and Loader Max are!) went very smoothly and works better than I could have hoped...it's destroying brought in content that's killing me!
I'm using LoaderMax (via the queue functionality) to bring in the SWF - an AS2 swf, which makes good use of TweenLite inside it and has a looping animation. SWF is loaded, fades in, and the loops runs perfectly....went I remove it though, although it completely disappears, the TweenLite animation loop obviously continues in the background (tellingme the SWF isn't being properly removed / garbage collected) as a couple of 'traces' I have in the loop keep firing. As I continue to press the button to load the same SWF, they are obviously stockpiling too - multiple fires of the traces go off, and keep going off. My fear is just that, sooner or later, memory will run out and the whole Flash plugin will fall over.
I've scoured the forums here and followed what advice I can understand from the Docs...i've used 'unload' on the queue, 'dispose(true)' and queue=null. If I null the queue or just dispose the whole thing seems to just stop working (ie. nothing loads the second time around). If I unload() it seems to do the trick, as the loop stops firing, BUT when I go to load the SWF again, I just get a blank background - the SWF loads, but its like all its movie clips have vanished. OR TweenLite just isn't firing, hence the stage objects just aren't appearing/animating. That make sense? I've tried regular AS3 stuff like removing all children of my specified container clip + the container clip itself in the hope of taking the SWF with it, but this doesn't seem to do the trick - I think maybe i'm misunderstanding how the rawContent comes in? I'm just removing its parent ContentDisplay object and its, er, grandparent. Either way...doesn't do the job. Specifying queue.load(true) - to indicate I want the previous content unloaded and specified SWF loaded again (I think) - just gives me that blank/bg only SWF when I hit the button again.
This an AS2 problem? Would TweenLite fuelled AS3 content not have this problem? Am I just unloading wrong? Do I have to kill the tweens in the sub movie when I remove it? Any help would be MUCH appreciated. Thanks!