Too much delay to load new SWF after unloaded the current SWF
Hi,
In our application we are using more than 10 SWFs. While traversing one SWF to other trying to unload currently loaded SWF and loading the new one. We were success to unload the existing SWF but the problem is, taking too much time to load new SWF (more than 5 seconds). Please suggest a useful method to avoid this delay to get better performance.
will get some idea from following code snippet.
Thanks
public function SwitchSWFs():void
{
if (null != SystemAgent.getInstance().currentSWFLoader)
{
SystemAgent.getInstance().currentSWFLoader.unload();
SystemAgent.getInstance().currentSWFLoader = null;
trace("HomeUI : Previous swf unloaded!!!");
}
else
{
}
addChild(SystemAgent.getInstance().swfLoaderSecondSWF);
SystemAgent.getInstance().currentSWFLoader = SystemAgent.getInstance().swfLoaderSecondSWF;
}
//will invoke from a button click
public function LoadSecondSWF():void
{
SystemAgent.getInstance().swfLoaderSecondSWF.load(new URLRequest("Second.SWF"));
SwitchSWFs();
}