Compiling iOS AIR 3.7 with external SWFs - switching to ADT compiler

With new AIR 3.7 developers have the option to make AIR apps that load external SWFs with assets and AS3 bytecode.
However, those SWFs have to be provided as arguments for ADT compiler, so that it can strip of the code, and leave in the assets.

I am having trouble compiling Adobe AIR 3.7 iOS app with IntelliJ. I noticed IntelliJ uses ADL for compiling, and not the ADT that I should use in this case.

So finally, my question is is there a way to make IntelliJ use ADT compiler and compile this kind of application?


IntelliJ IDEA uses mxmlc/compc or ASC 2.0 to compile, ADT to package and ADL to launch the app (and it is not possible to do the other way like to compile with packaging tool or to package with launching tool).

Your problem is not with compilation, it is with packaging. Release notes say that you need to create a TXT file with loaded SWFs relative paths, specify path to this TXT in AIR app descriptor and to include TXT file as well as loaded SWF files to the package. I guess you could miss the last step in IntelliJ IDEA: please check 'Files and folders to package' table at the iOS tab of the Flash build configuration (Project Structure dialog).


Thank you Alexander for your help!

I have tried this but it does not seem to be working because tha applicationDomain is totally empty while running the app on my iOS device, and i am still getting "Uncompiled actionscript error" even though i am using AIR 3.7.
Also, "Uncompiled actionscript error" seems to mean that ADT packager did not strip the code of the externals SWFs, and it did not generate “externalStrippedSwfs” folder like it should according to this


Is it possible to attach a sample project?


If you can't attach a sample project please attach IntelliJ IDEA project files zipped (.idea folder and all *.iml files) and also *.txt file with swf list


I have attached the files you asked for.

I was trying with everything in project root folder to avoid mistakes and just make it work... Also, i have added the files to "Files and folders to package"... So i really dont see a reason for this not working...


1. What seems suspisious for me is "-sampler asdasdadsa" ADT option. As  far as I know -sampler option should not be followed by the option  value. try to use just "-sampler" or even nothing in this field.

2. If you are using one of the latest IntelliJ IDEA 12.1 EAPs '-swf-version=20' option is set automatically, though your additional compiler options do not make any harm.

3. There's a total mess with your source roots and dependencies setup.

3.1. I guess you edit only source files located in the root 'src' folder. But you have configured 8 more source folders, including nested, that are children of 'lib' folder. Probably you need to configure some of them as Raw AS Library instead.

3.2. You have both InAppPurchase.ane and AirInAppPurchase.swc among dependencies. I guess you need to keep only *.ane

3.3. You have configured 'away3d-core-fp11_4_1_0_Alpha/src' as a Raw AS Library. Probably that's correct - source files in this folder will be compiled as if they were your own project files. Alternatively you can configure dependency on already compiled away3d.swc file.

3.4. Are lib/Encryption.swc and lib/rua-library/lib/Encryption.swc files equivalent? You have configured dependency on both of them. Probably one would be enough.

3.5. What's there in lib/rua-library/src? Now you have this folder both as a source folder and as a Raw AS Library. That's definitely a configuration error. If you are going to edit files in this folder - let it be a source folder (though it's strange to keep source files in lib folder). If you are not going to edit files there but use corresponding classes in your code - let it be Raw AS Library. Or may be you have already compiled SWC with required classes - then configure a dependency on SWC and setup lib/rua-library/src as library sources.

3.6. The same about lib/FlashMovieClipConverter-master/src

Let me take a look at your *.iml file once again when you fix project configuration.


Thanks againg for the help Alexander!
I changed the project structure, i think its ok now


Yes, looks much better. Among dependencies you have one ANE file, 10 SWC files and 6 uncompiled raw AS libraries.
Let me take a look at the Babyoteka-app.xml file if you still have problems with packaging.


Yes, still cant package the app... Here is the descriptor...


What iOS package type did you try (Build | Package AIR Application...)? How does the error look like? Try with 'Fast packaging' turned off.


I tried both fast packaging and standard packaging. With fast packaging application works because everyhing is packaged together, but obviousy, i cant use this.
With standard packaging i get "Uncompiled actionscript error" when trying to load my content from external SWFs. Because ADT did not generate "externalStrippedSwfs" i am not loading stripped swfs, but regular ones, so that must be the source of the error.

My first problem is that "externalStrippedSwfs" folder is not being created. I think if it was, loading would work, because external swfs would not contain any code, so i could not get "Uncompiled actionscript error".
On the other hand, second thing troubling me is that ApplicationDomain.currentDomain doesnt contain any definitions. Its totally empty.


Please look into the [IntelliJ IDEA installation]/bin folder. Probably "externalStrippedSwfs" folder is there.


No, unfortunately it is not there...


Today's official AIR SDK 3.7 release works better. Can you please try it?
For me it creates externalStrippedSwfs folder in [IntelliJ IDEA installation]/bin. I'll fix it to be placed in the same folder where ipa is created.


Please sign in to leave a comment.