PDA

View Full Version : Rotating a textfield in a circular path



cauchy
December 4th, 2007, 11:12 PM
Hi,

I'm having a problem with a movieclip that contains an object (a circle) in the middle. Off to the side is a text field. I want to rotate the whole movie clip at pre-determined degree increments and have the text field follow along. Although it does rotate, it will not follow a concentric circular path about the center--it's path is skewed by something--perhaps a transformation point that I can't locate. Other objects within the same movie clip do rotate properly.

I've attached a sample fla that demonstrates the problem by clicking the button to rotate the clip 90 degrees with each click.

Here is the stage code:
button_mc.addEventListener(MouseEvent.CLICK, onClick);

function onClick (event:MouseEvent):void
{

circle_mc.rotation +=90;
var currentRotation:Number = circle_mc.rotation;

circle_mc.dt_txt.text = currentRotation;
circle_mc.dt_txt.rotation = -currentRotation;

trace("current rotation = " + currentRotation);
}

button_mc.buttonMode = true;
Thanks!

Felixz
December 5th, 2007, 09:15 AM
place it into another MC and center or download my attachment

cauchy
December 5th, 2007, 04:38 PM
Thanks Felix! That is exactly what was needed to get this working.