1 Reply Latest reply on Oct 19, 2007 5:11 AM by beckmanVFX

    need help rotating a button

    beckmanVFX Level 1
      I'm very new to Flash ans AS3, but here's what I've got:

      I need my buttons to rotate on rollover and rollout. I've got it pretty close to what I want, but not quite.
      here's the code:

      import fl.transitions.*;
      import fl.transitions.easing.*;

      homeGear_mc.addEventListener(MouseEvent.MOUSE_OVER,buttonRotateOn);
      homeGear_mc.addEventListener(MouseEvent.MOUSE_OUT,buttonRotateOff);


      function buttonRotateOn(event:MouseEvent):void
      {
      TransitionManager.start(homeGear_mc, {type:Rotate, direction:Transition.OUT, duration:1, easing:Regular.easeInOut, ccw:false, degrees:90});
      }

      function buttonRotateOff(event:MouseEvent):void
      {
      TransitionManager.start(homeGear_mc, {type:Rotate, direction:Transition.IN, duration:1, easing:Regular.easeInOut, ccw:true, degrees:90});
      }


      so as this goes: if I hold the mouse over the button it rotates to 90 degrees and pops back to the starting position and keeps rotating over and over again. I need it to stop after 90 degrees and hold that position. I'm guessing I should use a stop action somewhere, perhaps as part of an "if" statement -still learning.

      also, when I roll out, the button rotates back to it's original position, but disappears when it gets there. Obviously I need it to hold.

      -any thoughts?
      thanks,
      mike