Skip to main content
Participating Frequently
February 15, 2013
Answered

Load SWF from remote server with ActionScript in AIR based iOS ipa

  • February 15, 2013
  • 3 replies
  • 12356 views

Hi Nimisha1,

Can you please confirm if I can Load SWF from remote server with ActionScript in AIR based iOS ipa?

Any help with regards to this is appreciated.

Thanks,

Amandeep Singh

This topic has been closed for replies.
Correct answer Nimisha1

Hi Amandeep,

You can't load a swf from a remote server which contains ActionScript.

Thanks,

Nimisha

3 replies

Abhinav_Dhandh
Adobe Employee
Adobe Employee
March 21, 2013

Hi everyone

The blog for the "External hosting of secondary SWFs on iOS" has been made live here :

http://blogs.adobe.com/airodynamics/2013/03/08/external-hosting-of-secondary-swfs-for-air-apps-on-ios

We have tried to explain the entire workflow of using this feature as well as how the behavior of loading & hosting of assets/ swfs has evolved over the previous AIR releases using graphical representations.

I hope it will  help clear the understanding of the entire feature.

Regards

Abhinav

Nimisha1
Nimisha1Correct answer
Participating Frequently
February 19, 2013

Hi Amandeep,

You can't load a swf from a remote server which contains ActionScript.

Thanks,

Nimisha

Nimisha1
Participating Frequently
March 15, 2013

Hi,

A new feature "External hosting of secondary swf files (iOS)" has been introduced with AIR 3.7 , please get more info @http://labsdownload.adobe.com/pub/labs/flashruntimes/shared/air3-7_flashplayer11-7_releasenotes.pdf

To use this feature please download AIR 3.7 build from http://labs.adobe.com/downloads/air.html.

Please share the feedback with us.

-Nimisha

Participating Frequently
March 15, 2013

I’m very excited about this feature since it addresses specifically the needs of my app.

However, I couldn’t make it work. The stripped assets file downloads fine, but when I try to access its content (ie. instantiate a symbol by its library name) the debugger states that the symbol doesn’t exist in the library, as well as that the custom class it’s linked to (via Base Class) doesn’t exist:

[SWF] SWFDownloadTest.swf - 944 bytes after decompression
ReferenceError: Error #1065: Variable CustomClass1 is not defined.

[SWF] /test/SWFDownloadTest/assets/assets.swf - 5,481 bytes after decompression
Symbol meepit doesn’t exist in the library or error loading the library

The last line it's a custom trace statement that pops up when:

ApplicationDomain.currentDomain.hasDefinition("meepit")


returns false.

I followed the example in the AIR 3.7 Release Notes regarding the LoaderContext, so that shouldn’t be the problem.

Anybody has had any luck in making this work?

Known Participant
February 15, 2013

It's been a while, but I believe you can only load "dumb" assets from

remote servers - that is SWFs with no bytecode. Just having bytecode is

enough to invalidate them. To be honest, I'm not even sure a clean SWF

(with no ABC or actionscript bytecode in it) will pass Apple's

guidelines - it's ultimately up to them.

For certain I can tell you, the iOS AIR bundle doesn't have the

necessary plumbing (a jit) to run any bytecode from any SWF, even if you

were allowed to load it (or figured out how to get the SWF under Apple's

radar, which I wouldn't recommend even trying). You'll need to compile

all AS3 into the main application.

Kevin N.