Home / Articles / Adobe Flash / Adobe Flash CS6 Classroom in a Book: Publishing for a Mobile Device

Adobe Flash CS6 Classroom in a Book: Publishing for a Mobile Device


  1. Publishing for a Mobile Device

Article Description

Learn how to publish Flash content for mobile devices running on Android or on Apple’s iOS using the mobile device simulator available with Adobe Flash Professional CS6.

Note: This excerpt is from the forthcoming book Adobe Flash CS6 Classroom in a Book, ISBN 9780321822512.

Publishing for a Mobile Device

You can also publish Flash content for mobile devices running on Android or on Apple’s iOS, such as the iPhone or iPad. To publish Flash content for a mobile device, you target AIR for Android or AIR for iOS to create an application that viewers download and install on their devices.

Creating an app for mobile devices is a little more complicated than creating an application for the desktop because you have to obtain specific developer certificates for distribution. Moreover, you have to factor in the additional time and effort required for testing and debugging on a separate device. However, Flash Professional CS6 features a mobile device simulator that can help make that testing and debugging easier. The simulator can emulate specific mobile device interactions such as tilting the device (using the accelerometer), touch gestures such as swiping and pinching, or even using the geolocation functions.

Simulating a mobile app

You’ll use the Adobe SimController to simulate mobile device interactions within Flash Professional CS6.

  1. Open 10Start_mobileapp.fla.
  2. The project is a simple application with four keyframes that announces an imaginary sports challenge set in our familiar city of Meridien. The project already contains ActionScript that enables the viewer to swipe the Stage left or right to go to the next or previous frames.

    Examine the code in the Actions panel. The code was added using the Code Snippets panel, which includes dozens of code snippets for interactivity on mobile devices.

  3. In the Properties inspector, notice that the Target is set for AIR 3.2 for Android.
  4. Choose Control > Test Movie > in AIR Debug Launcher (Mobile), which should already be checked.
  5. The project publishes to a new window. In addition, the SimController launches, which provides options to interact with the Flash content.

  6. In the Simulator panel, click Touch and Gesture to expand that section.
  7. Check the Touch layer box to enable it.
  8. The simulator overlays a transparent gray box over the Flash content to simulate the touch surface of the mobile device.

    You can change the opacity of the touch layer by changing the Alpha value, if you wish.

  9. Choose Gesture > Swipe.
  10. The simulator is now enabled to emulate a swipe interaction. The instructions at the bottom of the panel detail how you can create the interaction with just your mouse cursor.

  11. Press down on the touch layer over your Flash content, drag to the left, and then let go of your mouse button.
  12. The yellow dot represents the contact point on the touch layer of the mobile device.

    The project recognizes the swipe interaction, and the second keyframe appears.

  13. Swipe left and right.
  14. Flash advances ahead one frame, or moves back one frame.