Return to Snippet

Revision: 3532
at August 8, 2007 09:07 by 1man


Initial Code
function displayMessage ():Void {
	trace("Display this message");
	countInterval++;
	if(countInterval >= 10){
		clearInterval(nInterval);
		trace("interval cleared");
	}
}

var countInterval:Number = 0;
var nInterval:Number = setInterval(displayMessage, 1000);

Initial URL

                                

Initial Description
This will run the message function until countInterval equals 10, then it will stop. Could be used in various animations.

Initial Title
Basic Usage of setInterval

Initial Tags
animation

Initial Language
ActionScript