PDA

View Full Version : Tweener Rotation on Movieclips axis (itself)



lumi
August 26th, 2008, 12:39 PM
Guys I need to rotate a movie clip on its on axis so it doesnt move around but I cant get it to work. Please see my code below.. I am using tweener engine for this task.


import caurina.transitions.Tweener;

Tweener.addTween(mc, {rotation:360, time:3, transition:"easeIn", delay:2});

snickelfritz
August 26th, 2008, 02:50 PM
Please restate the question.
What is the "on axis"?

lumi
August 26th, 2008, 02:54 PM
i mean completing a rotation without moving from its x and y position

snickelfritz
August 26th, 2008, 03:33 PM
The xy position of objects is determined by the position of the registration point.
The axis of rotation occurs at the registration point.
Therefore, the xy coordinate of an object should never change due to rotation, since the rotation is occurring with the registration point at the center.


I believe the problem you are having is probably related to the registration point being located at the upper-left corner of the movieclip.
ie: it's a construction issue, not a code issue.

To move the registration point to the center of the movieclip (like the axle on wheel), simply edit the movieclip, select the shape or object and move it so that the little + marker is centered.
It should now spin like a wheel when you rotate it with Tweener.
You'll probably have to reposition the movieclip on the stage, since you have changed the position of the nested content.

lumi
August 26th, 2008, 03:49 PM
thank you so much.. u are the best