Jump to content


Call .unload from child swf??

Recommended Posts



Quick question as I'm a bit of a noob to LoaderMax.


I'm creating SWF files with custom content and loading them using LoaderMax. It's all working great. However, my external swf's are like "windows" with their own close buttons. In the past I've used:




This, however, does not work using LoaderMax. Is it possible to call unload from the loaded SWF (child)?


Any help would be greatly appreciated.


Many thanks,



Link to comment
Share on other sites

I think I got it...


private function unloadMe(evt:MouseEvent){
  var curParent:DisplayObjectContainer = this.parent.parent;


this.parent.parent gets me back to the DocumentClass where I can call unload after doing a couple of tweens :)

Link to comment
Share on other sites

Yep, good job. Keep in mind that your content is wrapped in a ContentDisplay object (just a Sprite with some extra functionality) which is why you had to do parent.parent.

Link to comment
Share on other sites

Awesome, thanks for the quick response (and the reassurance!)


I'm now trying to pass an identifier from the child which calls out the loader from which the call came. Ideally it would mean this function will work in the DocumentClass...


 private function actuallyUnload(loaderToUnload:Object){


... however it seems I can't access the unload() function because it's not on that ContentDisplay Object. I'll keep plugging away but any assistance would be great.


Thanks again.

Link to comment
Share on other sites

The ContentDisplay has a "loader" property which you can tap into.




That'll do (no need to call unload() first because dispose(true) does that plus more).

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.