I need a bit of help with a banner I’m making.
It’s a simple 600x150 eyes follow cursor type banner: http://bit.ly/9krb1I
Using the code:
stage.addEventListener(MouseEvent.MOUSE_MOVE, followCursor);
function followCursor(event:MouseEvent):void {
var coordy1 : Number = mouseY - eye1_mc.y;
var coordx1 : Number = mouseX - eye1_mc.x;
var angleRadians1 : Number = Math.atan2(coordy1,coordx1);
var angleDegrees1 : Number = angleRadians1 * 180 / Math.PI;
eye1_mc.rotation = angleDegrees1;
var coordy2 : Number = mouseY - eye2_mc.y;
var coordx2 : Number = mouseX - eye2_mc.x;
var angleRadians2 : Number = Math.atan2(coordy2,coordx2);
var angleDegrees2 : Number = angleRadians2 * 180 / Math.PI;
eye2_mc.rotation = angleDegrees2;
}
My question is, is it possible to make the eyes follow the cursor outside the movie stage? So when it is placed on a site which could be 1100x900, the eyes would follow the cursor on the entire page…
Hope it make sense… Thanks