Table of Contents

FlashDevelop

This document aims to help you set up FlashDevelop to use with Starling for desktop and mobile development.

If you find an error or a missing step, or if you have some other suggestion that might make things clearer for beginners, please help us out by enhancing this document! Just hit one of the Edit buttons and write away.

General Setup

You already downloaded the AIR SDK manually? In that case, you don't need “AppMan”, but you need to tell FlashDevelop where to find the SDK.

Go to: “Tools → Program Settings… → AS3 Content → Installed Flex SDK's (hit the square to the right of this with the 3 dots in it) → Add → Path (again, in the square) and point it to your SDK.

Project Setup

If you are a beginner and want to get started quickly, I recommend you create an “AS3 Project” that runs in the standalone Flash Player (the so-called “Projector). That's easiest to set up. Then, add the code shown in the Hello World example shown in the Starling Manual.

AIR only: Configuring "application.xml"

Open the file application.xml that's part of your project. You need to make sure about two things:

<application xmlns="http://ns.adobe.com/air/application/24.0">
<initialWindow>
  <!-- ... -->
  <renderMode>direct</renderMode>
</initialWindow>
The “application.xml” file is only required for AIR projects, not for AS3 Projects that target just the Flash Player.

Configuring the Project's SDK

Configuring "RunApp.bat"

This batch file is executed when you hit “Test Project” (F5).

Notes for iOS

Any mobile project setup with FlashDevelop will contain a file AIR_iOS_readme.txt. It contains detailed informations about how to work with iOS. Follow these instructions!

To make a release build, execute the “PackageApp.bat” script located in your project folder and choose “ipa-ad-hoc” or “ipa-app-store” when prompted. It's not enough to only choose the “Release” configuration in FlashDevelop and build the project .

Notes for Android

Any mobile project setup with FlashDevelop will contain a file AIR_Android_readme.txt. It contains detailed informations about how to work with Android. Follow these instructions!

To test the performance of Starling, always make a release build.

General Tips

Code Completion

FlashDevelop helps insert import statements in several ways.

When declaring something, if the class import hasn't been added yet, code completion will present a list of possible imports. Using arrow keys to select one and hitting enter will add the import code.

The other way is to place the cursor on the class name and press “CTRL + SHIFT + 1”. For example, if you were to write:

var bytes:ByteArray

Drop the cursor on ByteArray and try pressing “CTRL + SHIFT + 1”. That's if FlashDevelop doesn't automatically add the import (which it should if you complete the line with a semi-colon).

If the import hasn't been added, it will be added immediately, or a list will be presented with options if multiple classes with the same name are found (common when using Starling).

“CTRL + SHIFT + 1” is FlashDevelop's “Code Generator” shortcut, a super handy shortcut that does all sorts of wonderful things depending on the context where it's used.

Adding Resources to an AIR project

You will want to add files to an AIR project so that they are bundled with the application (allowing you to load them at runtime). In FlashDevelop, that happens with all the files found in the bin directory.

However, you probably don't want to place your assets in that folder – the bin folder is normally supposed to only contain files that are generated in the build-process.

Instead, I recommend you modify the file RunApp.bat so that it automatically clears all contents of the bin folder and then repopulates it with the contents of the assets folder (that's where you would put your assets).

set PAUSE_ERRORS=1
:: Clear bin folder and copy over assets to be packaged.
for /D %%p IN ("bin\*.*") DO rmdir "%%p" /s /q
xcopy "assets" "bin" /s /c /y /i /q

Troubleshooting

When I start the debug launcher, it says: error while loading initial content

You probably forgot to update application.xml so that it points to the same XML schema version as the AIR SDK you're using. Open it up and change the version number at the end of the application XML tag.