modifying 'compass' action script
Hi All,
The fla on this site:
Animations : Other : Compass_F5
rotates a compass needle to point in the direction of the mouse.
Can anyone see how to limit the part of the page which is 'active' i.e
the compass only moves if the mouse is on a given (small) part of the page. Below is the script.
Kind regards,
Phil
onClipEvent (enterFrame) {
agulha_x = int(_root.agulha._x-this._x);
agulha_y = int(_root.agulha._y-this._y);
if (agulha_x>0 && agulha_y>0) {
quadrante = Number(4);
}
if (agulha_x<0 && agulha_y>0) {
quadrante = Number(1);
}
if (agulha_x<0 && agulha_y<0) {
quadrante = Number(2);
}
if (agulha_x>0 && agulha_y<0) {
quadrante = Number(3);
}
abs_x = Math.abs(agulha_x);
abs_y = Math.abs(agulha_y);
tg = abs_y/abs_x;
_root.navy2 = Math.atan(tg)*Number(180)/Math.PI;
if (quadrante == 1) { angulo = number(90) - number(_root.navy2) }
if (quadrante == 2) { angulo = number(90) + number(_root.navy2) }
if (quadrante == 3) { angulo = number(270) - number(_root.navy2) }
if (quadrante == 4) { angulo = number(270) + number(_root.navy2) }
setProperty (_navy, _rotation, angulo);
}