Xristi

unloading child swf using button on the child swf

Recommended Posts

Hello,

 

I am using LoaderMax to load a child swf and it works very well, including the transfer of two variables from parent to child. However, I cannot locate any code (understandable to me) on this forum that indicates the code necessary in the parent and the code necessary in the child to accomplish this. I was able to do it in AS3 with a listener or two and a dispatch event but couldn't transfer the variables. I'd much rather use LoaderMax anyway.

 

This is the code for the loader in the parent:

queueIE.append(new SWFLoader("IntExtCode.swf", {name:swfMainLoader", estimated bytes:90000, container:this, x:5, y:10, autoPlay:false, onComplete:completeHandler}));

 

function completeHandler(event:LoaderEvent):void

{

event.target.rawContent.setProbNumber(catPracProblemNumber);

event.target.rawContent.setProbText(practiceProblemText_txt.text);

}

 

Can I put a listener (COMPLETE) in this function and use my regular as3 code that dispatches an event with a dispatchEvent in the child code?

 

Thank you for any help you can give me

 

Share this post


Link to post
Share on other sites

Sorry, I haven't done anything like that with LoaderMax in years. Unfortunately our support time can't be spent digging through AS3 as our entire focus is on HTML5 tooling.

 

For what it's worth, I do believe you should be able to dispatch an Event from the child and have the parent listen for it. I just don't know exactly how to set it up.

Share this post


Link to post
Share on other sites

Hi, I found the answer to my question in a 2010 response from Jack, "Eventlistener for a button in loaded SWF" using your tip and works perfectly. Thank you for your help!! and for GreenSock!

  • Like 1

Share this post


Link to post
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.