Posted By

marc0047 on 07/08/06


Tagged

time actionscript timeline


Versions (?)

Who likes this?

8 people have marked this snippet as a favorite

kanirasta
saveasraw
jkochis
kgosser
damarev
markfavazza
jitendramr
andrewrench


Executing time without timelines


 / Published in: ActionScript
 

  1. function time(func, delay) {
  2. clearInterval(waiter);
  3. waiter = setInterval(func, delay);
  4. }
  5.  
  6. // Sequence usage:
  7. // start();
  8. //
  9. // function start() {
  10. // trace("This is start 1");
  11. // time(finish, 2000);
  12. // }
  13. //
  14. // function finish() {
  15. // time();
  16. // trace("This is the end. The setInterval is cleared.");
  17. // }
  18.  
  19. // Simple go to next frame after time duration:
  20. // time(goNextFrame, 1000);
  21. // function goNextFrame() {
  22. // time();
  23. // _root.nextFrame();
  24. // }

Report this snippet  

You need to login to post a comment.