Jump to content


SWF unload not working after TweenMax inited

Recommended Posts



I'm working on cleaning up some legacy code so it can be unloaded from the parent SWF and ran into an issue that when any TweenMax function is called within a child SWF (eg. TweenMax.killAll(), just that, nothing else is called), it blocks the child SWF from being unloaded. The same issue cannot be repeated when instead of TweenMax I use TweenLite or TweenNano. Using advanced telemetry Adobe Scout just shows that TweenLite initializers are not garbage collected.


As a note, the parent SWF also uses TweenLite. The child SWFs are loaded into the parent in the same application domain and security domain using LoaderMax.


I am using  * VERSION: 12.0.0 * DATE: 2013-01-21 of TweenNano and  * VERSION: 12.1.5, * DATE: 2014-07-19 of TweenMax (the latest package)


Any ideas as to what might cause this are appreciated.


I would upload the scout session files but those are ~14mb each, instead I can offer dropbox links:




Link to comment
Share on other sites

Hm, tough to say without seeing a reduced test case, but here are a few ideas:

  1. Have you tried using a different ApplicationDomain so that the classes are segregated? I wonder if the fact that you're using TweenLite in the parent swf is causing complications because when TweenMax loads in the child, it extends TweenLite which already exists in that ApplicationDomain and piggy-backs on it and the cross-references are preventing GC (just a guess)
  2. Are you using LoaderMax's SWFLoader to do all the subloading and unloading? Flash has lots of bugs related to loading and LoaderMax/SWFLoader implements various workarounds. I know several of the bugs were related to Flash refusing to release things for GC in subloaded swfs in certain circumstances. 
  3. Did you allow adequate time for gc to occur? Remember, TweenLite/Max hold on to references to tweens for up to a maximum of about 120 ENTER_FRAME events before releasing them for gc in order to improve performance. 
  4. Can you reproduce the problem in a stripped-down set of files that have only the absolutely essential code to show the issue? 
Link to comment
Share on other sites

Thanks for the input, I'll do some experimenting when I have the time. I am unloading using the built in Loader.unloadAndStop(); I'll give SWFLoader a try. I definitely allowed enough time for 120 enter frames to pass.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.