Skip to main content
Known Participant
August 29, 2013
Question

loading SWF with code - fails

  • August 29, 2013
  • 1 reply
  • 848 views

I packaged up my iOS application which loads SWFs containing bytecode. I set my swf-version=21 and when I packaged it, the resulting swf (when I look inside the IPA package) was only 511 bytes. (its an 85k swf of almost all code). I guess this means it stripped the code properly???

The SWF loads (as in the loader returns something), but when I try to get the content using event.target.content, it fails to make a movieclip out of it.

var request:URLRequest = new URLRequest(url);

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

load(request, loaderContext);

Air version is 3.8.

Any ideas what I might be doing wrong?

PS I am pretty sure the basic app is functional because the Android port works fine.

This topic has been closed for replies.

1 reply

Nimisha1
Participating Frequently
August 30, 2013

Hi Blakflag,

What error are you receiving on iOS? Have you tried the same code with any other secondary SWF?

PS: Feature Multiple SWFs on iOS is different from the Android, have you read the blog https://blogs.adobe.com/airodynamics/2012/11/09/packaging-and-loading-multiple-swfs-in-air-apps-on-ios/?

Thanks,

Nimisha

Participant
October 1, 2013

I have been debugging a simmilar issue trying to package a secondary swf as a proof of concept.

I am using the ClassLoader example provided with http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/system/ApplicationDomain.html

This works fine in any state where the intrepeter is invoked so this means that builds that do not include the debugger return an "Uncompiled Action Script" error and when I am stepping through with the flash debugger the secondary swf is not loaded into the ApplicationContext.

I have tried a project configuration that uses the externalSWFs in the mxml descriptor and without. This doesn't have any affect.

I am building both as files with debugging mode enabled.

I invoke adt this way

$AIR_LOC/adt -package -target ipa-ad-hoc -listen 9999 \

-keystore $KEY_LOC/ttm_app_key.p12 -storetype pkcs12 -storepass pass \

-provisioning-profile $KEY_LOC/AIR_ADHOC_Mobile.mobileprovision \

$BUILD_LOC/Mobile.ipa \

mobile-app-as3-as.xml \

Main.swf icons Blank.swf

Main.swf is the ROOT swf and Blank.swf is a very simple class that can manipulate a stage passed into it. But I cannot get past the loading on iOS.

I cannot tell if the ABC is actually being included in the ROOT swf or not.

Since the ClassLoader example uses getDefinition the application when not interpreted thows up here as that class is not being loaded on the non-interpreted iOS build.

I am really at a loss. I have read through the link above a number of times and I cannot figure out why iOS continues to declare that I am loading Uncompiled as

Thanks

BlakflagAuthor
Known Participant
October 1, 2013

One of my problems was that my main SWF version was not high enough, even though I thought it was. (swf-version must be >= 20 I think?)

You could try checking inside the IPA package and see if the stub swf it creates looks like mine did (a very small swf with only a few bytes) That might tell you something.

I know it's really frustrating when it doesn't work... the iOS sandbox restrictions are annoying for sure.