AS3 : CLOSE EXTERNAL SWF AND GET BACK TO MAIN TIMELINE

291 views Asked by At

I had a main timeline that call an external.swf file like this.

var loadcase1:Loader = new Loader();
var urlcase1:URLRequest = new URLRequest("external.swf");
loadcase1.load(urlcase1);                                    
addChild(loadcase1);

but when the external.swf opened, i want it have a button that can take me back to my main timeline... can anyone help me ? please... thanks...

1

There are 1 answers

0
Andrey Popov On

You need to add button from your main "swf" (which is main all the time, just the secondary is added on top of it). Otherwise you need to make call from the secondary back to the primary (which is potentially bad, risky and awful practice, but in your case maybe good enough):

MovieClip(parent).callPublicFunction(); // Secondary.as

removeChild(loadcase1); // Main.as - removes the loade ("secondary") swf