Posted By

dada78 on 04/03/10


Tagged

setTimeout


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

dada78
Fakeham


setTimeOut to delay functions


 / Published in: ActionScript
 

If you do not want to convert it to seconds and prefer to use milliseconds then you can use the following: stop(); function wait() { play(); // Just continue playing // gotoandplay(50); // Play a specific frame or frame label // someFunction(); // Call a function // etc... } setTimeout(wait, 4500); // milliseconds

  1. // setTimeOut Example
  2. stop();
  3. var timelineDelay:Number = 5; // Pause the TimeLine (in seconds)
  4. function wait() {
  5. play(); // Just continue playing
  6. // gotoandplay(50); // Play a specific frame or frame label
  7. // someFunction(); // Call a function
  8. // etc...
  9. trace("Timeline was delayed "+timelineDelay+" seconds, now continuing");
  10. }
  11. setTimeout(wait, timelineDelay*1000); // converts from milliseconds to seconds
  12. // (1000 milliseconds = 1 second)

Report this snippet  

You need to login to post a comment.