Skip to main content
July 4, 2013
Answered

Problem with merged SWF

  • July 4, 2013
  • 1 reply
  • 767 views

I have a Problem. I just merged two SWF inserting the second on the first one with the following code in AS3:

var request:URLRequest = new URLRequest("destino.swf");

var loader:Loader = new Loader()

loader.load(request);

addChild(loader);

This is a slide file, something like powerpoint where you can navigate through the slides with the arrows. I merged two SWF because it's a presentation with images and videos, The problem is that if I navigate back, the slides of the second SWF get mixed with the first one:

I'll show you a video with the problem. After the video is when the first SWF load the second one.

I hope you can help me.

This topic has been closed for replies.
Correct answer kglad

when you want to go back, execute:

loader.unload();

(and, if there's a stream in destino.swf, use loader.unloadAndStop() )

1 reply

kglad
Community Expert
Community Expert
July 5, 2013

when you "navigate back", remove your loader from the stage or, even better, apply the unload() method to it:

loader.unload();

July 5, 2013

And how can implement that in the code. That code has to be on one slider before the slider where is the loader?

Thanks

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
July 5, 2013

when you want to go back, execute:

loader.unload();

(and, if there's a stream in destino.swf, use loader.unloadAndStop() )