Skip to main content
April 9, 2018
Question

Load and Unload multiple SWFs

  • April 9, 2018
  • 1 reply
  • 1279 views

Hello everyone...

This is my biggest problem in Animate AS3 ever. So the problem is-

I have 8 SWFs which have separate topic in each and one main SWF file and i want to connect all of them together like-

Firstly i open Main SWF then it shows all the 8 topics name with each button. i used script from code snippets which is 'Click to load/unload SWF' and i assigned all the SWF as it required to open. I have created a button in each SWF to go back to main SWF using same code as i mentioned.... It is working properly but i realized that each time i click to open new SWF, it overlape on old one and when i open multiple times all SWFs, it become very heavy and get legging and hangs very much, consumes more memory...

So what can i do to load new SWF and unload all previous SWFs by clicking on same button in each SWF ???????

Please give some idea with whole script which i have to paste with button name and file name(u can assume any button name and file name).

As i don't have enough knowledge about writing manual code.

Please give some positive response.

Thanks....

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
April 9, 2018

use one loader for all your loads (eg, loader) and use:

if(loader.content){

loader.unloadAndStop();

}

loader.load(new URLRequest(whatever));

April 9, 2018

Sir,

Thanks for your reply... But can you please give detailed script for just one file ???

April 9, 2018

I mean, full script... Not just a part....