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

    setInterval question

    icelizardman Level 1
      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) {
      clearInterval( intervalID );
      } else {
      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.