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---
**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;
}**
var point:Point = new Point(mc.x+ mc.width / 2,mc.y+ mc.height / 2);
i am calculating the center point of mc containing the textfield using the above method.
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 ---mc.x+ mc.width / 2,mc.y+ mc.height / 2---
How do i calculate the perfect origin of a text field at any angle of rotation.