6 Replies Latest reply on Nov 19, 2007 7:11 PM by chris1122

    Accumulating Button Actions

    chris1122
      I need some advice with a problem I'm having trying to make a VERY simple set of actions work in the new version of Flash CS3 with ActionScript 3.0.

      All I'm trying to do is make a set of buttons that perform simple play, stop, next and back functions and the code below is as far as I've gotten:

      The buttons attached to this code work well, except when it plays through more than once, the number of frames that the next and back buttons go to accumulate so that the first time they advance or back up one frame, the next time two, etc.

      I have these actions all on one layer. I tried separating them and changing the order and it keeps happening.

      Can you help me with this?

      Thanks,
      Chris

      nextBtn.addEventListener(
      MouseEvent.MOUSE_UP,
      function(evt:MouseEvent):void {
      nextFrame();
      }
      );

      backBtn.addEventListener(
      MouseEvent.MOUSE_UP,
      function(evt:MouseEvent):void {
      prevFrame();
      }
      );


      play_btn.addEventListener(
      MouseEvent.MOUSE_UP,
      function(evt:MouseEvent):void {
      play();
      }
      );


      stop_btn.addEventListener(
      MouseEvent.MOUSE_UP,
      function(evt:MouseEvent):void {
      stop();
      }
      );