We Recommend

Visual Basic 2008 Programmer's Reference Visual Basic 2008 Programmer's Reference
Visual Basic Orcas Programmer's Reference is a language tutorial and a reference guide to the upcoming Orcas release of Visual Basic. The tutorial provides basic material suitable for beginners but also includes in-depth content for more advanced developers.


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.