getTimer function

getTimer() : Number

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

Availability: ActionScript 1.0; Flash Player 4

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

Version 8

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/8/main/00001729.html