ok, i was wrong, looks like you dont even need the quadrant
checks...thats my memory for you :)
i made a little movie with a circular movie clip, the reg point was in
the middle, and another movieclip called pointer, which is just a line
going up from the reg point, then this code did the trick
circle.onRelease = function()
{
x = this._xmouse;
y = this._ymouse;
angle = Math.atan2(y,x) * (180 / Math.PI);
_root.pointer._rotation = angle + 90;
}
thanks,
i havent written code like that in a long time, its quite fun being old
skool ;)
Martin.
Merrill, Jason wrote:
Ah, rotate to the click point, right. So combine Martin's trig and my
suggestion of the tween classes to move to a new rotation angle, and you
should have what you need.
Jason Merrill | E-Learning Solutions | icfconsulting.com
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:flashcoders-
[EMAIL PROTECTED] On Behalf Of Martin Wood
Sent: Tuesday, November 01, 2005 3:22 PM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Circle, rotation to ?
but you'll need some trigonometry to work out the rotation angle from
the point that is clicked.
if my memory serves me, you can use Math.atan2( y, x ) to get you
the
angle in radians, but i think you have to do some quadrant checking to
get the right answer.
the quadrant check itself is easy, just check if x is left or right of
the midpoint, and if y is above or below.
that should get you going.
martin
Merrill, Jason wrote:
No math required, just use the tween and transition mx classes to
tween
to a new rotation.
Jason Merrill | E-Learning Solutions | icfconsulting.com
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:flashcoders-
[EMAIL PROTECTED] On Behalf Of eric dolecki
Sent: Tuesday, November 01, 2005 3:10 PM
To: Flashcoders mailing list
Subject: [Flashcoders] Circle, rotation to ?
I have a math question. Lets say I have a circular movieclip on the
stage.
It has a directional marker on it so you know which direction its
rotated
to.
click on the circle, now with easing (even just linear), rotate to
the
movieclip from its current rotation to the destination angle (where
the
movieclip was clicked on). To work in full 360 degrees.
Anyone have any good suggestions on the best way to code this, or
an
example
to boot?
Thanks,
e.dolecki
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
NOTICE:
This message is for the designated recipient only and may contain
privileged or
confidential information. If you have received it in error, please
notify the sender
immediately and delete the original. Any other use of this e-mail by
you is
prohibited.
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
--
want to know what i think? probably not
http://relivethefuture.com/choronzon
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
--
want to know what i think? probably not
http://relivethefuture.com/choronzon
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders