code:
/*************
vars -
cx = center of girl's head (x-position)
cy = center of girl's head (y-position)
dx = change in x from girl's head to mouse
dy = change in y from girl's head to mouse
rads = angle from positive x-axis to line from girl's head in radians
degs = same as rads but in degrees
frame = frame number to go to
*************/
dx = _root._xmouse - cx;
dy = _root._ymouse - cy;
// get angle
rads = Math.atan2(dy, dx);
// convert to degrees
degs = 180 / Math.PI * rads
// convert to 0-360 just in case
frame = Math.floor(degs) % 360;