Chapter 6. Timing

CREATING YOUR OWN timer is common in Flash movies and is especially important when you do not want to rely on the timeline. Playback controls, countdown clocks, or any other form of time measurement are examples of timing functionality.

In this chapter, we’ll compare the timing options in ActionScript 2 and 3, and look at two new AS3 classes, called Timer and TimerEvent, that handle timer events.

Setting a Time Interval

Developers use time intervals in Flash projects to repetitively call a function or class method. Both versions of ActionScript let you use the setInterval function to create this functionality; however, AS3 offers a more robust solution using the Timer and TimerEvent classes.

AS2: Setting a Time Interval

The most efficient ...

Get The ActionScript™ 3.0 Migration Guide: Making the Move from ActionScript 2.0 now with O’Reilly online learning.

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