# Rotate around its own axis

**URL:** <https://forum.kirupa.com/t/rotate-around-its-own-axis/184290>\
**Category:** flash\
**Created:** [April 4, 2006, 2:37am UTC](https://forum.kirupa.com/t/rotate-around-its-own-axis/184290 "2006-04-04T02:37:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jkusunoki](https://avatars.discourse-cdn.com/v4/letter/j/f9ae1b/32.png) [@jkusunoki](https://forum.kirupa.com/u/jkusunoki)\
**Post date:** [April 4, 2006, 2:37am UTC](https://forum.kirupa.com/t/rotate-around-its-own-axis/184290/1 "2006-04-04T02:37:32Z")

</div>

**Hi Guys,**

[SIZE=2][COLOR=#004080] **I’m trying to make some kind of Compass and I want to know how I could make the needle spin around its own axis with one of the ends following the mouse pointer. how could I do that?**  
[/COLOR][/SIZE]  
**Thank you very much**

---

<div class="post-metadata">

**Author:** ![kpxnamja](https://avatars.discourse-cdn.com/v4/letter/k/7c8e57/32.png) [@kpxnamja](https://forum.kirupa.com/u/kpxnamja)\
**Post date:** [April 4, 2006, 4:27am UTC](https://forum.kirupa.com/t/rotate-around-its-own-axis/184290/2 "2006-04-04T04:27:44Z")

</div>

Here’s an option:  
[http://www.actionscript.org/tutorials/advanced/Mouse\_Angle\_Detection\_II/index.shtml](http://www.actionscript.org/tutorials/advanced/Mouse_Angle_Detection_II/index.shtml)

---

<div class="post-metadata">

**Author:** ![phorte](https://avatars.discourse-cdn.com/v4/letter/p/77aa72/32.png) [@phorte](https://forum.kirupa.com/u/phorte)\
**Post date:** [April 4, 2006, 6:43am UTC](https://forum.kirupa.com/t/rotate-around-its-own-axis/184290/3 "2006-04-04T06:43:06Z")

</div>

actually u can just use  
Math.atan2(\_xmouse,\_ymouse)

that will give the angle in radian, to your mouse.

---

<div class="post-metadata">

**Author:** ![jkusunoki](https://avatars.discourse-cdn.com/v4/letter/j/f9ae1b/32.png) [@jkusunoki](https://forum.kirupa.com/u/jkusunoki)\
**Post date:** [April 8, 2006, 11:48pm UTC](https://forum.kirupa.com/t/rotate-around-its-own-axis/184290/4 "2006-04-08T23:48:22Z")

</div>

Thanks to all friends, that was really helpful, if you guys wanna see what did i do with that action visiti this link:  
[http://www.elcomercioperu.com.pe/elecciones2006/brujula.html](http://www.elcomercioperu.com.pe/elecciones2006/brujula.html)  
Thank you very much

---

<div class="post-metadata">

**Author:** ![phorte](https://avatars.discourse-cdn.com/v4/letter/p/77aa72/32.png) [@phorte](https://forum.kirupa.com/u/phorte)\
**Post date:** [April 9, 2006, 12:26am UTC](https://forum.kirupa.com/t/rotate-around-its-own-axis/184290/5 "2006-04-09T00:26:56Z")

</div>

Very nice man… Glad we could be a help.
