Jump to content
Search Community

Call .unload from child swf??

RapaNui test
Moderator Tag

Recommended Posts

Hi,

 

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:

 

Movieclip(this.parent).unLoadContent();

 

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,

 

J.

Link to comment
Share on other sites

I think I got it...

 

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

 

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

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){
  loaderToUnload.unload();
  loaderToUnload.dispose(true);
  loaderToUnload=null;
 }

 

... 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

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.
×
×
  • Create New...