Posted By

1man on 08/08/07


Tagged

setInterval animation timing


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

gasface
arala22
digitalifer


Basic Usage of setInterval


 / Published in: ActionScript
 

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

  1. function displayMessage ():Void {
  2. trace("Display this message");
  3. countInterval++;
  4. if(countInterval >= 10){
  5. clearInterval(nInterval);
  6. trace("interval cleared");
  7. }
  8. }
  9.  
  10. var countInterval:Number = 0;
  11. var nInterval:Number = setInterval(displayMessage, 1000);

Report this snippet  

You need to login to post a comment.