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 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.