3 Replies Latest reply on Sep 10, 2006 8:44 PM by kglad

    easy timer question

    Level 7
      I am using this time and am having some issues with it. Right now,
      everything I am trying to do, works fine, except I want to have a button
      that will reset the timer. What I am doing with this is that I stop on a
      frame, the timer gets triggered and once it counts down all the way, it
      moves to the next frame to play. I now created a button and would like
      it to stop the playhead as long as the mouse is on the button. I am
      trying to do this like so:

      On that frame I have:

      stop();

      displayTime = 6;
      countDown = function () {
      displayTime--;

      if (displayTime == 0) {
      clearInterval(timer);
      gotoAndPlay("closing");
      }
      };

      timer = setInterval(countDown, 1000);


      What I can't figure out, is what to put on that button?
      on(rollOver){
      //reset timer
      timer = setInterval(countDown, 1000);
      }

      But that does not seem to do it?

      Tank you for any help with this!
      Brian