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

  • Download and install latest 32-bit JRE (Java Runtime Environment) version. (https://java.com/tr/download/manual.jsp)
  • Download and install FlashDevelop.
  • Launch FlashDevelop.
  • Open up “AppMan” via “Tools → Install Software”.
    • Select “Compilers / AIR SDK + ASC 2.0”
    • Select “Runtimes / Flash Player (SA)”
    • Click “Install 2 items”
    • When done, close “AppMan”
  • At this point, I had to restart FlashDevelop for the installed SDKs to show up.

Project Setup

  • Enter “Project → New Project” and pick one of the following:
    • “AS3 Project” for a Flash Player SWF project
    • “AIR Mobile AS3 App” for an iOS or Android app
    • “AIR AS3 Projector” for an Desktop application
    • “AS3 Library SWC” for an SWC library project (like Starling)
  • Set Name & Location
  • Add Starling:
    • Via “Project → Properties”, add a classpath that points to starling/src within the Starling download/Git folder. (recommended)
    • Or create a lib folder in your project and copy starling.swc into it; then go to “Project → Properties → Compiler Options → SWC Libraries” and add the entry lib/starling.swc.
  • For starters, add the code shown in the Hello World example shown in the Starling Manual.

Configuring "application.xml"

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

  • The xmlns must point the same AIR version that you installed via “AppMan”. The sample below shows the value for “AIR 24”.
  • Make sure that renderMode is set to direct. That's required so that Starling may use Stage3D.
<application xmlns="http://ns.adobe.com/air/application/24.0">
<initialWindow>
  <!-- ... -->
  <renderMode>direct</renderMode>
</initialWindow>

Adding Resources

You will want to add files to a 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).

  • To do that, edit the file bat/RunApp.bat and find the line that says:
set PAUSE_ERRORS=1
  • Now add this on a new line after it:
:: 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

Setting up the SDK

  • In “Project → Properties”, make sure that the latest AIR SDK is selected. (The one you installed via “AppMan”.)
  • To make sure you can use all the features of the AIR SDK, you have to set the correct “SWF Version”.
    • Find the correct SWF version for your AIR SDK here: Adobe AIR Feature List
    • Navigate to “Project → Properties → Compiler Options → Additional Compiler Options”.
    • Add an entry like this: -swf-version=35

Configuring "RunApp.bat"

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

  • The section :target controls how you want to launch/debug your application. For example,
    • if “goto desktop” is uncommented, you will debug on the Desktop via “adb”.
    • if “goto android-debug” is uncommented, the app will be installed and started on an attached Android device.
  • The section :desktop controls the screen resolution used in the adb debugger.

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!

  • If you need help enabling USB debugging on your device this document contains some more details: Run Apps on a Hardware Device
  • You will also need a certificate with which to sign the app. Create it using /bat/CreateCertificate.bat and wait a minute.
To test the performance of Starling, always make a release build.

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.

  manual/flashdevelop.txt · Last modified: 2017/02/25 12:42 by 91.93.52.71
 
Powered by DokuWiki