Highlighted

Unload SWF that was previously loaded by AS3?

Explorer ,
Feb 12, 2019

Copy link to clipboard

Copied

I found this code on the web that loads my swf file into another movie.  I use a button to load the swf and I would like to add a button to unload it and show what was there previously.  I really don't understand AS3 and would really appreciate some help.

var container1:Sprite = new Sprite();

addChild(container1);

button_4.addEventListener(MouseEvent.CLICK, loadSwf1);

function loadSwf1(e:MouseEvent):void{

if(container1.numChildren < 1){

  var loader1:Loader = new Loader();

  loader1.y = 99;

  loader1.load(new URLRequest("mcc-demo.swf"));

  container1.addChild(loader1);

}

}

The original code is here:  ilike2Flash: Load multiple external swf in AS3

Adobe Community Professional
Correct answer by JoãoCésar | Adobe Community Professional

Hi.

Please see this answer:

Unload SWF and Return to a frame in the Initial SWF

Don't hesitate to ask if you need further assistance.

Regards,

JC

Views

121

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Unload SWF that was previously loaded by AS3?

Explorer ,
Feb 12, 2019

Copy link to clipboard

Copied

I found this code on the web that loads my swf file into another movie.  I use a button to load the swf and I would like to add a button to unload it and show what was there previously.  I really don't understand AS3 and would really appreciate some help.

var container1:Sprite = new Sprite();

addChild(container1);

button_4.addEventListener(MouseEvent.CLICK, loadSwf1);

function loadSwf1(e:MouseEvent):void{

if(container1.numChildren < 1){

  var loader1:Loader = new Loader();

  loader1.y = 99;

  loader1.load(new URLRequest("mcc-demo.swf"));

  container1.addChild(loader1);

}

}

The original code is here:  ilike2Flash: Load multiple external swf in AS3

Adobe Community Professional
Correct answer by JoãoCésar | Adobe Community Professional

Hi.

Please see this answer:

Unload SWF and Return to a frame in the Initial SWF

Don't hesitate to ask if you need further assistance.

Regards,

JC

Views

122

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Feb 12, 2019 0
Adobe Community Professional ,
Feb 12, 2019

Copy link to clipboard

Copied

Hi.

Please see this answer:

Unload SWF and Return to a frame in the Initial SWF

Don't hesitate to ask if you need further assistance.

Regards,

JC

__________________________________________
HTML5, JSFL, and AS3 samples: http://bit.ly/2mJgDoG

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 12, 2019 0
Explorer ,
Feb 12, 2019

Copy link to clipboard

Copied

I think this will work for me if I can figure out how to tweak it.

Thank you for the quick reply and sorry for the slow response...I had to wait until I arrived home because I can't download files behind my company firewall.

If I have any issues I will be back.  Thanks again!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 12, 2019 0
Explorer ,
Feb 12, 2019

Copy link to clipboard

Copied

Uggh, it's 99% of what I need to do.  One problem though is that I am mimicking a browser in my presentation.  The fake browser in my movie has two tabs that allow the user to tab back and forth.  It's really a button to a different scene.  I have used your reset button as a sort of "back" button on the 2nd frame, but the user needs to be able to also tab back and forth between the two tabs.

Is there a way to attach that reset functionality to another button in the FIRST frame so it clears the loaded movie?

EDIT:  If this is complicated don't sweat it.  I just discovered I can delete the tab button at that frame so the user can switch tabs when they are previewing the "English" movie.  When they reset they can use the tabs.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 12, 2019 0
Adobe Community Professional ,
Feb 13, 2019

Copy link to clipboard

Copied

Hi.

Did you manage to solve the issue?

__________________________________________
HTML5, JSFL, and AS3 samples: http://bit.ly/2mJgDoG

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 13, 2019 0
Community Beginner ,
Feb 14, 2019

Copy link to clipboard

Copied

I fixed it to 99% of what I need.  Ideally I could have the reset button on frame 1, but it's not a show stopper.  Thanks for your help!

(I am the same guy as above...this is my work account)

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Feb 14, 2019 0