title: Rotating a Text Field in as3
body: <p>I am working on a Flash Project in which i have to rotate a text field.I am Rotating the text field using this function---</p>
  
  <pre><code>**function rotateAroundCenter(ob:*, angleDegrees)
  {
  
      var m:Matrix = ob.transform.matrix;
      m.tx -=  point.x;
      m.ty -=  point.y;
      m.rotate(angleDegrees*(Math.PI/180));
      m.tx +=  point.x;
      m.ty +=  point.y;
      ob.transform.matrix = m;
  }**
  </code></pre>
  
  <p><strong>var point:Point = new Point(mc.x+ mc.width / 2,mc.y+ mc.height / 2);</strong></p>
  
  <hr>
  
  <p>i am calculating the center point of mc containing the textfield using the above method.</p>
  
  <p>I Have also povided the dragging feature so that one can drag the text field.
   The problem is when i rotate the text field say 45 degrees and then  i drag it to other position now if i rotate the text field again it is not rotating about its center or origin, it rotates about some other point that is calculated by the same method <strong><em>---mc.x+ mc.width / 2,mc.y+ mc.height / 2---</em></strong></p>
  
  <p>How do i calculate the perfect origin of a  text field at any angle of rotation.</p>