With the newly released AIR 3.2 SDK, you can take advantage of Stage3D and achieve (near) native performance on iOS devices. As an example, I get a steady 58 frames per second on an iPad 2 when rendering 400 Sprites with Starling (Sprite size: 81×140 pixels).
However, getting Flash ready to export to your iOS device and take advantage of Starling is a bit of a challenge. You need to overcome these two challenges:
- Overlay the AIR 3.2 SDK onto Flash CS 5.5
- Get your app to use the “direct” render mode, which is required by Starling
Step Two: Get Flash to use the direct render mode in iOS
Starling requires a render mode of “direct.”
Unfortunately, Flash CS 5.5 doesn’t currently support the ability to choose this render mode when building for iOS.
See here: http://screencast.com/t/bJicMLHPevq
The solution is a bit of a hack.
You need to alter your app’s XML file and then make the file read only for PC, or locked on a Mac.
- Open your Flash project’s XML file.
As an example, my FLA is called “starlingIpadTest.fla”, so the app XML file is called “starlingIpadTest-app.xml”.
See here: http://screencast.com/t/fwceyJ76iZ
- Look for the <renderMode> tag. Set the render mode to “direct” like so:
- Make the file read only (PC) or lock it (Mac).
You can now deploy your app and test it on your iPhone or iPad.
Getting the latest AIR SDKs to work with Flash CS 5.5 is a big pain. The following steps will save you some trouble. (This is for Win 7, but something similar should work for Mac, I suppose)
Note: As always, make backups of anything that you overwrite.
It would be foolish to try this without a way to undo these changes.
1. Download the latest AIR 3.2 SDK here:
2. Extract the SDK
3. Rename the parent folder “AIR3.2″
4. Place the “AIR3.2″ folder in <FLASH CS5.5 DIR>\
(on Windows 7, this is located here: C:\Program Files (x86)\Adobe\Adobe Flash CS5.5)
5. Create a directory named “AIR3.2″ in <FLASH CS5.5 DIR>\Common\Configuration\ActionScript 3.0\
6. Copy AIR3.2\frameworks\libs\air\airglobal.swc and paste it in the newly created <FLASH CS5.5 DIR>\Common\Configuration\ActionScript 3.0\AIR3.2 directory
7. Navigate to <FLASH CS5.5 DIR>\Common\Configuration\Players\
8. Paste in the XML files found in this ZIP file: flashAirXML.zip
9. Remove (back up to somewhere) any other iOS XML file that already exists in <FLASH CS5.5 DIR>\Common\Configuration\Players\
You can have multiple Android XML files here, but not iOS. I have no idea why.
You can now build to iOS with AIR 3.2 and take advantage of Stage3D!