7. Creating Timer and Frame Events

In addition to mouse events, there are two types of events that will be helpful for you in your applications. The first is the timer event, which is an internal stopwatch in ActionScript that you can use to trigger events after a specific amount of time. The second is the frame event, which is triggered every time a new frame in the Flash runtime is displayed.

This chapter will introduce both types of events and will show you when to use them appropriately.

Using the Timer Event

When you need to create events based on time, you need to use a timer, known in ActionScript as Timer. A timer and its related event type, TimerEvent, is like a countdown clock. You define how long you want a timer to run, and it will ...

Get Fundamentals of ActionScript 3.0: Develop and Design 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.