Jump to content


Dispose swf content.

Recommended Posts



I'm trying to use the dispose() method but it doesn't work like I had expected.

I have 3 swf's: "Menu", "Game" and "Container". The last one loads in the first two.

But, when I'm done with the menu, I'd like to unload the swf and all the classes I had loaded in it.


menu = (LoaderMax.getContent("Menu.swf") as ContentDisplay).rawContent;


(LoaderMax.getLoader("Menu.swf") as SWFLoader).dispose(true);
menu = null;


With the code above, the classes won't be garbage collected.

Is there an option to remove them all without setting every instance to null in the "Menu" swf?

I've already tried to use a different application domain.

Link to comment
Share on other sites

If you're still holding a reference to an object in AS3, Flash won't release it for garbage collection - that has nothing to do with LoaderMax/SWFLoader. So yes, you need to null any variables that reference your unloaded stuff.

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.