3 Replies Latest reply on Aug 20, 2010 7:47 AM by kglad

    Placing a stop to Tweened Buttons

    matt23chi

      Hi Guys,

       

      I realize I might have done this the hard  way, but bear with me as I am brand new to flash and need to get a  simple presentation done for my boss by the end of the afternoon.

       

      I  have created set of dials/meters with moving arms that change as  buttons are pressed.  The arms move based on a "Classic Tween" set-up I  created.  I then applied my buttons to the flash document and then coded  in some "gotoAndPlay" on an actions layer to get the arms on the dials  to move when I click on the buttons.  My problem is that since I have 3  buttons (High, Medium & Low) and the tweens follow one frame right  after another (0, 41,78) there is no stop.  When I click on Low it plays  the low tween, the medium one, and the high tween.  When I click on the  medium it plays both the Medium and then the High.  The High button  obviously only plays itself.  I don't know how to insert a stop between  these buttons.  Can you guys help me?  I have pasted my simple code  below os you can see it:

       

      stop();

       

      low_btn.addEventListener(MouseEvent.CLICK, onLow);
      function onLow (Event:MouseEvent):void
      {
           gotoAndPlay(0)
      }

       

      med_btn.addEventListener(MouseEvent.CLICK, onMed);
      function onMed (Event:MouseEvent):void
      {
           gotoAndPlay(41)
      }

       

      high_btn.addEventListener(MouseEvent.CLICK, onHigh);
      function onHigh (Event:MouseEvent):void
      {
           gotoAndPlay(75)
      }

      Please, please, please help me.

       

      Thank you so much.