title: how to stop a rotating movieclip at max/min angle?
body: <p>I have a button (decrease), and when the button is pressed an arrow rotates left. I need the arrow to stop at a certain angle (approximately at 8 o'clock). </p>
  
  <p>How can I get the angle of the arrow, and then stop it from rotating past this point (even if the user keeps pressing the button)?</p>
  
  <p>Here's my code:</p>
  
  <pre><code>import flash.display.MovieClip;
  import flash.events.MouseEvent; 
  import flash.events.Event;
  
  stop();
  
  var rotate = 0;  
  
  decrease.addEventListener(MouseEvent.MOUSE_DOWN, decreasePressed);  
  decrease.addEventListener(MouseEvent.MOUSE_UP, removeEnterFrame); 
  
  function decreasePressed(e:MouseEvent):void  
  {   
          rotate = -2;
          addEnterFrame();
  }
  
  function addEnterFrame():void 
  {     
      this.addEventListener(Event.ENTER_FRAME, update); 
  }  
  
  function removeEnterFrame(e:MouseEvent):void 
  {     
      this.removeEventListener(Event.ENTER_FRAME, update); 
  }  
  
  function update(e:Event):void 
  {     
      arrow1.rotation += rotate;
  } 
  </code></pre>