2 Replies Latest reply on Jun 27, 2006 12:49 AM by Newsgroup_User

    alternative to setInterval()

    DZ-015 Level 1
      I'm looking for a way to continually update the properties of a movie clip... there is some math involved, but basically it's just copying the properties (_x, _y - nothing too fancy) from one movie clip to another.

      I use setInterval() currently, and just think there must be a way to do it more intuitively.

      Any suggestions?
        • 1. Re: alternative to setInterval()
          Level 7
          Hi!

          Each instance of a movieclip calls a function called onEnterFrame every time
          a frame changes. You can define what this function should do yourself, so if
          you got a movieclip called MyClip, you could do:
          MyClip.onEnterFrame = function() {
          ... do what you want ...
          }

          Makes sure to keep track of your scope and targetpaths, etc.

          /Jensen/



          "DZ-015" <webforumsuser@macromedia.com> wrote in message
          news:e7qn41$n5l$1@forums.macromedia.com...
          > I'm looking for a way to continually update the properties of a movie
          > clip...
          > there is some math involved, but basically it's just copying the
          > properties
          > (_x, _y - nothing too fancy) from one movie clip to another.
          >
          > I use setInterval() currently, and just think there must be a way to do it
          > more intuitively.
          >
          > Any suggestions?
          >


          • 2. alternative to setInterval()
            sneskid
            the other best alternative to setInterval is onEnterFrame.
            infact i've lately been switching over to it.
            Don't get me wrong though, setInterval will always have a place next to my heart.