Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
In the previous section, we learned how to use Event.ENTER_FRAME to create animations synchronized with the Flash runtime's frame rate. In this section, we'll see how to synchronize animations with an arbitrary time interval, specified using the flash.utils.Timer class.
The Timer class is a general utility class for executing code after a specified time interval. Each Timer object dispatches TimerEvent.TIMER events at a programmer-specified frequency. Functions wishing to be executed at that frequency register with the Timer object for TimerEvent.TIMER events.