setInterval

Calls the specified function after the specified interval.


Availability:

First available in version 3.5.

Available only in ActionScript 3.


Usage:

intervalID = setInterval(functionName, intervalTime [,arg0 ... argN])

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


Parameters:

functionName - String - Name of the function to call after the interval specified has passed.

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

args0 ... argsN - [Optional] - Any number of arguments can be passed to the function.


Notes:

Works in the same way that setInterval in ActionScript works. The function will be called continuously until clearInterval is called.


Examples:

Example 1:
This example calls a function every 2 seconds to send a value to the trace window.

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

displayInterval = setInterval("displayStatus", 2000, "status");