SupAIR Pong – Adobe AIR 2.6 for iOS in action

SupAIR Pong's icon

SupAIR Pong splash screen

SupAIR Pong splash screen

I can't play pong

When newest version of Adobe AIR came out I needed to give it a try, of course.
It has been a while since I’ve done some coding in AIR, beacause for the last few months I focused on developing native iOS applications (Objective-C, C++, Xcode) and wrote only a small AIR app for BlackBerry PlayBook to check out the tools and workflow (sadly, it’s not developer-friendly).

Adobe AIR 2.6 doesn’t user PFI (Packager for iPhone) anymone, now it’s using the same tool for generating mobile iOS and Android applications. Also, iPhone 2G and 3G are no longer supported, due to “armv7″ and “opengles-2″ requirements for the target runtime (UIRequiredDeviceCapabilities).

The packaging process is faster than with PFI / AIR 2.5 (AIR 2.6: 45-50 seconds, AIR 2.5: 2-4 minutes). My pong clone runs smoothly on iPhone 3Gs 30fps and it’s a highly addictive game. The AIR 2.6 apps support iOS 4 features like multitasking, so you can save and resume your applications’ state. The game has a super-feature: you can change the colors (see the video).

SupAIR Pong will be available  on the App Store soon (if it gets accepted :) .

AIR 2.6 mobile workflow is way better than AIR for BlackBerry PlayBook (BBP), because you can test your app in the simulator and with BBP Tablet it’s not that easy

  • you need VM Ware to run the BBP simulator (30day trial then you need to buy it) / standard adt simulator doesn’t have required APIs (QNX) will crash with most apps
  • the BBP simulator doesn’t support orientation change / you need to use your imagination to test portrait mode
  • the BBP simulator doesn’t support cameras /  you need to use your imagination and then pray for the code to work
  • you need to use command line quite often – it’s not possible to remove an application from the simulator in any other way
  • QNX components are really ugly – check out the green preloader icon. Skinning them is a slow and tedious task. QNX components use Tweener internally (strange choice, since TweenMax/TweenLite is a lot faster)

Few things to remember:

  1. You cannot use <img> tag inside TextField’s htmlText property due to Adobe AIR’s security policy
  2. Use cacheAsBitmap on static textfields (boosts performance)
  3. doubleClickEnabled property doesn’t work, user flash.utils.getTimer instead (the same thing happens on BlackBerry PlayBook)
  4. When embedding fonts set embedAsCFF=”false” (when using font with AS3 TextFields)
  5. stage.stageWidth and stage.stageHeight properties contain wrong screen dimensions. On my iPhone 3Gs (480×320 fullscreen) and in the simulator the size was 500×375. (a bug ? ). Wasted some time wondering why graphics aren’t positioned correctly.
  6. Clicks on html links inside TextFields are working really bad on the device (3Gs), it was very hard to get a TextEvent.LINK event to fire. In the simulator everything’s fine. Had to change this approach to oridinary Sprites to act as buttons.

One thought on “SupAIR Pong – Adobe AIR 2.6 for iOS in action

  1. hi i wonder if you could help me, i have been struggling to get an app icon on my app for ipad. i have been coding with adobe flash builder 4.6.

    thanks in advance