Share Posted September 25, 2012 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 More sharing options...
Author Share Posted September 25, 2012 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 More sharing options...
Share Posted September 25, 2012 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 More sharing options...
Author Share Posted September 25, 2012 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 More sharing options...
Share Posted September 25, 2012 The ContentDisplay has a "loader" property which you can tap into. loaderToUnload.loader.dispose(true); That'll do (no need to call unload() first because dispose(true) does that plus more). Link to comment Share on other sites More sharing options...
Author Share Posted September 25, 2012 Perfect. Thanks a million. Awesome. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now