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"); 
}

1 Answer 1

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)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.