-
Movieclip rotation to 360 degrees?
Hi guys,
I know this should be simple! It's driving me nut's that i've had to ask this question!!! I've searched google, searched the board -- but i cannot work it out.
trace(myMovieClip..rotation) is returning the -180 for left side and +180 for right side
How do i get this rotation to be out of 360 degrees?
Thanks so much for the help!
-
hey, if you want to use from 0 to 360, you can always convert it with a function like
function toFlashRotation(value:Number):Number
{
return (value%360<180) ? value%360 : -(180 -(value%360 - 180)) ;
}
//trace(toFlashRotation(200)) = -160
function fromFlashRotation(value:Number):Number
{
return (value>0) ? value : 180 + (180 -Math.abs(value)) ;
}
//trace(fromFlashRotation(-175)) = 185
-
Dignitary
To explain why you get -180 to 180:
Your using the rotation property of a diplayObject. Values of that are -180 to 180. Values outside this range are added to or subtracted from 360 to obtain a value within the range.
This applies to all other rotation properties as well, ie. rotationX, rotationY etc.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|