User Guide
318 Chapter 2: ActionScript Language Reference
getTimer()
Availability
Flash Player 4.
Usage
getTimer() : Number
Parameters
None.
Returns
The number of milliseconds that have elapsed since the SWF file started playing.
Description
Function; returns the number of milliseconds that have elapsed since the SWF file started playing.
Example
In the following example, the getTimer() and setInterval() functions are used to create a
simple timer:
this.createTextField("timer_txt", this.getNextHighestDepth(), 0, 0, 100, 22);
function updateTimer():Void {
timer_txt.text = getTimer();
}
var intervalID:Number = setInterval(updateTimer, 100);
CHAPTER 2
ActionScript Language Reference