/ Published in: ActionScript
This will run the message function until countInterval equals 10, then it will stop. Could be used in various animations.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
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);