Chapter 4. Rethinking ActionScript Programming

WHAT'S IN THIS CHAPTER?

  • Reusing objects

  • Caching bitmaps

  • Optimizing your frame rate

  • Using GPU rendering

Flash and Flex developers have been working with ActionScript for years now and have created a storehouse of ActionScript 3 (AS3) programming techniques and open-source code libraries. However, when it comes to developing applications for Android and iOS mobile devices, it helps to borrow the old 90s Apple slogan: Think Different. When you develop for the Web or desktop environments, you don't have to be overly concerned about CPU resources or memory constraints.

That's not so with smaller mobile devices. Although the latest iPhone and Android offerings feature faster and faster processors and greater amounts of RAM, their capacities remain small compared to desktop varieties. As a result, to create an app that performs well, you need to think different when it comes to your programming techniques and application architecture.

This chapter walks you through key issues to think about as you develop your apps.

CONSERVING MEMORY AND CPU RESOURCES

The tips and techniques that you work with in this chapter deal with minimizing both the memory and the CPU resources that your apps use. Unfortunately, these two objectives can be at odds with each other. As you'll see, sometimes when you take a step to decrease memory, you strain the CPU and vice versa.

One of the common questions that mobile AS3 developers ask is this: which should I be more concerned ...

Get Professional Flash® Mobile Development: Creating Android™ and iPhone® Applications now with O’Reilly online learning.

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