0

I have a main fla in which i load an external swf locally. First time when I load the swf it works fine.

On clicking the home button (on external swf) I have removed the movieclip containing the external swf.

On loading the external swf again from main screen it gives me a blank screen on iOS device. How can I reload my swf?

This is working fine for Android Devices. I am getting this problem only in iOS devices.

var home:homebtn=new homebtn();
var swfLoader:Loader = new Loader();
var _lcd:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
var swfFile:URLRequest = new URLRequest("external.swf");
var container:MovieClip= new MovieClip(); 

swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, swfLoadedHandler);

function swfLoadedHandler(e:Event):void {
    addChild(home);
    home.x=_width/2;
    home.y=20;
    home.addEventListener(MouseEvent.CLICK,gotohome);
}

swfLoader.load(swfFile,_lcd);
container.addChild(swfLoader);
addChild(container);


function gotohome(evt:MouseEvent):void
{
SoundMixer.stopAll();
removeChild(container);
removeChild(home);
home=null;
gotoAndStop(1,"Homescreen"); 
}
Shahbaz Pothiawala
  • 1,175
  • 5
  • 20
  • 38

1 Answers1

0

Do some research. Duplicate of:

Load and reload external SWF in AIR for iOS

Adobe AIR, IOS, and Multiple SWFs - Returning to a previously loaded SWF

It depends if the swf have code in it, and if it is being cached. There is an extended article in one of the posts.

p.s. Cannot mark as duplicate as those questions does not have accepted answers (which I found strange, as there are solutions)

Community
  • 1
  • 1
Andrey Popov
  • 7,362
  • 4
  • 38
  • 58