4 Replies Latest reply on Dec 28, 2006 2:00 AM by Devendran

    setInterval question

    icelizardman
      I have tried search the forums, loads of stuff on setInterval but couldnt find what i want.

      i am using:
      function advanceFrame() {
      //loop timeline using if statement
      if (test._currentframe == test._totalframes) {
      test.stop();
      clearInterval( intervalID );
      } else {
      test.nextFrame();
      clearInterval( intervalID );
      }
      }

      var tmp = Math.round (Math.random ()*20);
      intervalID = setInterval(this, "advanceFrame", 1000/tmp);

      The plan is for tmp to change each time the interval is called what is the best way to do this? thanks for all help in advance.