# Rotate & Mouse

**URL:** https://forum.kirupa.com/t/rotate-mouse/167206
**Category:** flash
**Created:** [October 26, 2005, 8:24am UTC](https://forum.kirupa.com/t/rotate-mouse/167206 "2005-10-26T08:24:42Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![BORKOYz](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@BORKOYz](https://forum.kirupa.com/u/BORKOYz)
#### Post date: [October 26, 2005, 8:24am UTC](https://forum.kirupa.com/t/rotate-mouse/167206/1 "2005-10-26T08:24:42Z")

</div>

I need a mc to rotate to the mouse, now it works but only if its not in another movieclip, what i mean is i have a movieclip in a movieclip which will rotate when the mouse moves.

My script is on a mousemove Event.

Xd = \_root.cursor.\_x-\_x;  
Yd = \_root.cursor.\_y-\_y;  
radAngle = Math.atan2(Yd, Xd);  
\_rotation = int((radAngle_360/(2_Math.PI))+90);  
updateAfterEvent();
