O'Reilly logo

The ActionScript™ 3.0 Migration Guide: Making the Move from ActionScript 2.0 by Kris Hadlock

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required