3 Replies Latest reply on Nov 13, 2006 3:29 PM by Newsgroup_User

    Infinite loop

    Tume91 Level 1
      I need infinite loop what runs all the time for checking my main timeline variables. How I can do it? It should work no matter what is current frame. Can I just use for loop?
      Thanks.
        • 1. Re: Infinite loop
          arunbe Level 1
          try _root.onEnterFrame function. But, using this function is not fair...
          But, if you want you can use this....
          • 2. Re: Infinite loop
            Level 7
            look into setInterval()... onEnterFrame will work but consumes much more
            in the way of system resources

            Tume91 wrote:
            > I need infinite loop what runs all the time for checking my main timeline variables. How I can do it? It should work no matter what is current frame. Can I just use for loop?
            > Thanks.
            • 3. Re: Infinite loop
              Level 7
              > look into setInterval()... onEnterFrame will work but consumes much more
              > in the way of system resources

              What makes you say that? I've never heard anything about onEnterFrame using
              more resources. If anything, it would use less as it does not involve a
              timer etc, it gets handled as a part of the existing frame updating
              processing.

              onEnterFrame runs at exactly the right time so that it is called at the same
              rate as the display is updated (regardless of what that may be).

              With setInterval, it can very easily run too fast (if you set the interval
              too short) and waste resources as a result, or it can easily run too slow
              (if you set the interval too long) getting delays.

              onEnterFrame is ideal for something where you want processing done at the
              actual movie frame rate.
              --
              Jeckyl