-
_rotation problem
Hi
I have been using _rotation in a movie as follows:
Line.onEnterFrame = function ()
{
if (this._rotation < 122)
{
this._rotation += 5.833333
}
};
This works well until I want the movie clip Line to rotate more than 180 degrees (for 20 frames) and then stop.
If I put say <182 in the above code the movie clip rotates continuously.
I am sure there is an answer related to how Flash geometry works, but I don't seem to be able to come up with it.
Or should I be using a different approach?
I would appreciate any ideas.
Regards
-
In Flash angles are measured from -180 degrees to +180 degrees. when the value goes above 180 it is wrapped around to the corresponding negative value.
Hence the angle will always be less than 182.
You could maybe try using something like,
if (this._rotation > -177) {
}
to get the result you're looking for.
-
Thanks for that. Would I be correct in assuming that from 12 to 6 o'clock the angle will be between 0 and 180 degrees and from 6 to 12 between -180 to 0?
-