There are several methods in ActionScript for dealing with time. We have shown before how to find a user's response time using the getTimer() method as we did in the enanced (final) version of the Arithmetic Quiz from the tutorial, "Using Textboxes in an Arithmetic Quiz" in our Basic section.
In the present tutorial, we will show how to use a Timer object to create animated motion or a simple repeated event. On a related note, there is a Date class that allows you to display the system time. We show how to combine this class with a Timer object to create a simple digital clock effect.
The source file for the examples in this tutorial can be downloaded together in timers.zip. Each individual source file can be found on the page that explains that example.