I'm just messing around with actionscript and I wanted to make a movieclip always face the mouse. How would I go about to do this?

EDIT: Nevermind I got it!

Here it is if anyone ever needs it:
Code:
personTurning = function ()
{
var x:Number = (_xmouse - _root.person1._x)
var y:Number = (_ymouse - _root.person1._y)
var angleInRadian = Math.atan2(y,x)
angleInRadian += (Math.PI/2)
var angleInDegrees = angleInRadian *(180/Math.PI)
_root.person1._rotation = angleInDegrees
}
person1 is the movieclip that you want to be facing the mouse
CPU AMD X2 5000+ BE @ 3.008 24/7 |
Motherboard GA-M57SLi-S4 |
Memory 2 x 2gb Patriot DDR2 800 |
Graphics Card Diamond 4870x2 |
Hard Drive 500Gb WD + 500Gb Seagate |
Sound Card Creative X-FI Extreme Music + Denon AVR-2700 |
Power Supply Corsair HX620w |
Case Gigabyte 3D Aurora <- Returned for Aurora 570 :) |
CPU cooling Apogee GT + PA120.3 |
GPU cooling MCW-60 + PA120.3 |
OS Vista Home Premium 64-bit |
Monitor Samsung 2232gw |