1 Reply Latest reply on Jul 5, 2008 4:57 PM by Newsgroup_User

    sleep()-like function in flash

    polatkanfatih Level 1
      i need a sleep-like function. for example for(i=0;i<10;i++), I want "i" to increase after a time interval, i.e. i need a functio n which will make function wait....
        • 1. Re: sleep()-like function in flash
          Level 7
          polatkanfatih,

          > i need a sleep-like function. for example for(i=0;i<10;i++), I
          > want "i" to increase after a time interval, i.e. i need a functio
          > n which will make function wait....

          There is no sleep() equivalent in ActionScript, so you're not likely to
          find a solution for a for() loop. You do, however, have setInterval() and
          setTimeout() in ActionScript 1.0/2.0 and the Timer class in ActionScript
          3.0. All of the above have the capability of executing a specified
          function/method after a specified perioud of time, in milliseconds.


          David Stiller
          Adobe Community Expert
          Dev blog, http://www.quip.net/blog/
          "Luck is the residue of good design."