Skip to main content
Participant
July 25, 2011
Question

Air app works on Android, wont start when republished for iPad

  • July 25, 2011
  • 2 replies
  • 907 views

Hi,

I am using Flash Professional CS5.5 on Windows.

I am looking to convert an existing set of published SWF files and MP3 files and wrap them up in a small Air app to work on mobile devices.  I took those SWFs and MP3s and created a new Air app project for Android and published it and it seems to work just fine.  For your reference, I just had the Air app start up the first SWF by using Loader and URLRequest to load in the SWF that was bundled into the app.  The code I used to do this is:

var swfLoader:Loader = new Loader();

addChild(swfLoader);

var bgURL:URLRequest = new URLRequest("0001/myswf.swf");

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

swfLoader.load(bgURL);

function loadProdComplete(e:Event):void {

   trace("file loaded");

}

Next, I tried the exact same thing for an iPad: I created a new Air app for iOS, loaded my certificate and mobile provisioning profile, copied the same 8 lines of code as above and included my SWFs and MP3s.

I published, used iTunes on my Mac to sync it, but no go.  I can get a very simple Air app running on iOS that does nothing but display some graphics, but I seem to be stuck with loading complex SWFs.

Has anyone done this before?

Thanks,

Bob

This topic has been closed for replies.

2 replies

Participating Frequently
August 1, 2011

Loading swfs with actionscript code is not allowed in AIR on iOS, even if it not loaded externally. If your swf doesn't contain actionscript, you should make sure you are passing an actual URL to new URLRequest() and not a file's native path.

Regards

-Sanika

Participant
July 25, 2011

It turns out that the SWFs I am loading in all have actionscript in them, which is a problem iOS.  It was not a problem for Android.  Just iOS.

Does anyone have a list of all of the limitations of Air for iOS?

relaxatraja
Inspiring
July 26, 2011

The major limitation on IOS is to keep all your script at one place where you are compiling the package (mostly the index file). So External swf must not be with an script even the stop() command. Otherwise you can do all the things, like loading video, audio, xml etc. Have all the video and audio as an external source and attach it while packaging. The thing to be taken care for performance. It differs based on the updated on AIR from old version to new versions.