Flash Media Server Developer Documentation

clearInterval()

clearInterval(intervalID)

Stops a call to the setInterval() method.

Availability

Flash Communication Server 1

Parameters

intervalID An identifier that contains the value returned by a previous call to the setInterval() method.

Example

The following example creates a function named callback() and passes it to the setInterval() method, which is called every 1000 milliseconds and outputs the message "interval called." The setInterval() method returns a number that is assigned to the intervalID variable. The identifier lets you cancel a specific setInterval() call. In the last line of code, the intervalID variable is passed to the clearInterval() method to cancel the setInterval() call.

function callback(){trace("interval called");}
var intervalID; 
intervalID = setInterval(callback, 1000); 
// sometime later 
clearInterval(intervalID);