Accessing bitmaps with ActionScript

The GPU found on iOS devices is optimized for rendering bitmaps rather than the complex vector shapes that can be produced using Flash. This makes bitmaps the preferred graphics option when building high performance apps. While bitmaps can be stored in the library and simply dragged to a timeline during development, they can also be directly manipulated at runtime using ActionScript.

This recipe will show you how to add a bitmap to the display list at runtime.

Getting ready

From the book's accompanying code bundle, open chapter6\recipe6\recipe.fla into Flash Professional.

Sitting in the library is a bitmap named monkey.png. We will write code to add this bitmap to the display list.

How to do it...

We will split this ...

Get Flash iOS Apps Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.