We Recommend

Textpattern Solutions: PHP-Based Content Management Made Easy Textpattern Solutions: PHP-Based Content Management Made Easy
Textpattern is a powerful, PHP-based content management system that allows you to build pretty much any kind of data-driven website quickly and easily. It is very popular among designers and developers alike, and has an active community of users.


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.