setTimeout

Executes the specified code one time after the specified number of milliseconds.


Availability:

First available in version 3.5.

Available only in ActionScript 3.


Usage:

timeoutID = setTimeout(code, timeoutTime)

timeoutID - Number - Id that can be used to clear the interval.


Parameters:

code - String - Code to execute after the timeout specified has passed. The code will be evaluated at runtime.

timeoutTime - Number - Time in milliseconds before the specified function is called.


Notes:

Works in the same way that setTimeout in JavaScript works. The function will be called once unless clearTimeout is called before the timeoutTime.


Examples:

Example 1:
This example calls a function once after 2 seconds have passed.

function displayStatus(value)
{
    trace(value);
}

displayInterval = setTimeout("displayStatus('status');", 2000);