Tutorial: How to change AIR SDK in FlashDevelop

Changing AIR SDK in FlashDevelop can be a daunting task if you have never done it before. It certainly has been for me when I wanted to switch from AIR 3.9 to AIR 4.0. So I resolved to write a step-by-step guide to help people like me who have never switched AIR SDKs before and at the same time to have a handy reference for myself when it comes to upgrade AIR SDK again.

In this tutorial I am using the latest development build of FlashDevelop which you can download for free here:

http://flashdevelop.org/downloads/builds/

Choose:

FlashDevelop-master.exe if you want to install FlashDevelop on your computer.

FlashDevelop-master.zip if you want a stand-alone version of FlashDevelop.

STEP 1 – Download & Install SDK(s)

Once you have successfully installed FlashDevelop on your computer, let’s proceed to download the new AIR SDK.

In the Tools menu choose Install Software… (Tools > Install Software…)

This will pop-up a window called AppMan where you can select a number of SDKs and other useful things to download, install and use in FlashDevelop.

Check all the relevant SDK boxes and click on the Install button in the bottom right corner.
Checking Flex+AIR SDK will download,  install and merge the two SDKs (Flex and AIR). Using this option for compilation will make FlashDevelop use the ActionScript Compiler 1 (ASC1).
Checking AIR SDK + ASC 2.0 will download and install the latest AIR SDK. Using this SDK to compile will result in compiling with the ASC2.

About the ActionScript Compiler (ASC)

Written in Java, and distributed as a Jar file (asc.jar), the ASC allows to compile *.as source code to an *.abc file (ActionScript Byte Code), or to a *.swf file, or to an executable file.
The ActionScript Compiler 2.0, or ASC2, has been introduced as part of the AIR 3.4/Flash Player 11.4 SDK preview and Flash Builder 4.7 Preview. ASC2 is now distributed with Flash CC (Flash C++ Compiler) and the AIR SDK (since AIR 3.6).
Learn more about ASC 2.0 and the differences between ASC 1.0 and ASC 2.0 here: http://www.bytearray.org/?p=4789

STEP 2 – Edit SetupSDK.bat

Let’s restart FlashDevelop and check that the SDKs we have just downloaded have been correctly installed and registered in FlashDevelop.

Choose Tools > Program Settings > AS3Context > Installed SDKs and you should see the SDKs you have just installed in this list.

While we are looking at the Installed Flex SDKs, let’s click on the little button with 3 dots […] next to InstalledSDK[] Array.
A new window will pop up:

2014-03-02 08_37_25-InstalledSDK Collection Editor

Let’s take note of our SDK’s path (in this example: C:\Program Files\FD\Apps\flexairsdk\4.6.0+4.0.0) .
Now let’s open bat/SetupSDK.bat and make sure we are using this path for FLEX_SDK:

:: Path to Flex SDK
set FLEX_SDK=C:\Program Files\FD\Apps\flexairsdk\4.6.0+4.0.0

STEP 3 – Edit Your Project’s Properties

From the Project menu choose Properties… (Project > Properties…)

In the Output Tab, where it says ‘Platform’, select the SDK version you want to use.

In the SDK tab select the SDK you want to use:

Finally in the Compiler Options tab, expand the Additional Compiler Options and add:

-swf-version=23

Quad (AS3) Properties

At the time of writing the latest SWF version is 23, but obviously this will increase with future versions of the runtime. For a complete list of SWF version numbers see here: http://www.adobe.com/devnet/articles/flashplayer-air-feature-list.html

Check your compiler version (optional)

While we are here, we can perform a quick test to double check if we are using ASC 2.0. Just add:

-inline

to the list of Additional Compiler Options and if you get no error messages during compilation complaining about the -inline parameter then you are successfully using ASC 2.0. This is because the inline functionality is only implemented in ASC 2.0 and not in ASC 1.

properties_inline

STEP 4 – Edit Your Application Descriptor

In your application descriptor (application.xml) change application xmlns to reflect the AIR SDK you are using (in this example 4.0):

<application xmlns="http://ns.adobe.com/air/application/4.0">

DONE!

That’s it, now you should be able to successfully compile your project with the AIR SDK of your choice!

I hope you found this tutorial useful, please feel free to ask questions or add your feedback in the comments section below.

If you are interested in my random ramblings and philosophical disquisitions you can follow me on twitter @framais

Thanks for reading!

Advertisements

12 thoughts on “Tutorial: How to change AIR SDK in FlashDevelop

  1. Based on the discussions on the FlashDevelop forums, I assume this requires a development build of FlashDevelop? I’m running the latest production release (4.5.2) and there is no Tools > Install Software… menu item.

    Thanks for taking the time to write this. I’m about to go through the same upgrade and this makes my life much easier! 🙂

  2. Hi Chris, thanks for pointing this out,you are correct this is based on a development build of FlashDevelop, updating AIR SDK with a production release involves manually downloading the necessary SDKs. I will update the tutorial specifying this as soon as I have a minute 🙂

  3. what are the things to be ticked from apps option..could we manually download.

  4. Flex sdk is getting error message at the end of download process.i have tried it two times but failed.

  5. my flex + air sdk is: 4.6 and 14.0… and yours is 4.6 and 4.0… why ?

    • Because Adobe regularly releases new versions of the AIR SDK. If you are wondering why such a big gap between version 4 and version 14, it’s because Adobe decided to use the same version number for AIR SDK and the Flash Player, so they jumped from 4 to 13, and then obviously, 14.

  6. I don’t know why but where you’re supposed to put the folder it says Matriz InstalledSDK[] and when I try to release a project it says: Error:Unable to open libs/player/17.0/playerglobal/swc

  7. In case you’re reading this I’ve already fixed it, thank you for making this tutorial, I’ve been days trying to install this.

  8. Thanks for the excellent write-up, this helped immensely 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s