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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.