Flash Lite 2.x and 3.0 ActionScript Language Reference

getTimer function

getTimer() : Number

Returns the number of milliseconds that have elapsed since the SWF file started playing.

Returns

Number - 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);