Skip to main content
Participant
February 9, 2014
Answered

External Swf on Android Air and IOS Air

  • February 9, 2014
  • 1 reply
  • 2695 views

Hello

Can android AIR and IOS AIR app download and play external SWF with code inside?

I have created android AIR app(SDK version 4.0) which load external swf with simple movie clip on the scene.

var loader:Loader=new Loader();

loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaded);

loader.load(new URLRequest("2.swf"));

function onLoaded(e:Event):void

{

     addChild(loader);

}

I have installed this android AIR app on device but i do not see external swf on the scene.

Thanks in advance

This topic has been closed for replies.
Correct answer kglad

you must add the external swf to the included files.  and for ios you must assign the loadercontext property.

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
February 9, 2014

you must add the external swf to the included files.  and for ios you must assign the loadercontext property.

ByelikAuthor
Participant
February 9, 2014

So for ios as3 code must be like this one.?

var _urlRequest:URLRequest = new URLRequest("2.swf");

var _loader:Loader = new Loader();

var _lc:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);

_loader.load(_urlRequest, _lc);

addChild(_loader);

One more question: How exactly  i can add the external swf to the included files?

Can you give link with information or some sample? Also, does it work on Android Air?

If you have sample for ios Air or for Andoid Air i will be very appreciative.

Sorry for my english.

kglad
Community Expert
Community Expert
February 9, 2014

yes, to your loadercontext question.

and in the edit application settings > general tab is an included files text area where you can add files and directories.