I’m using the basic mouse follow technique i stole from some tutorial, yes i understand it, but im in a rush:D
I’m trying to make it ease to the spot but it doens’t seem like there is a way.
It is jumpy, i would like to it to slowly smooth to the current mouse location. It’s going to be used for a touch screen;)
Heres my current AS:
stop()
face.onRollOver = function(){
startDrag("mouseTarget", true);
onMouseMove = function(){
mouse_x = mouseTarget._x;
mouse_y = mouseTarget._y;
xDistance = mouseTarget._x - face._x;
yDistance = mouseTarget._y - face._y;
// set the normalisation factor
if (Number(xDistance)<0) {
normalise = -1 * xDistance;
} else {
normalise = xDistance;
}
if (Number(yDistance)<0) {
normalise = Number(normalise)+Number((-1 * yDistance));
} else {
normalise = Number(normalise)+Number(yDistance);
}
// determine the direction
if ((Number(xDistance)>=0) and (Number(yDistance)>=0)) {
direction = 90*(yDistance/normalise);
} else if ((Number(xDistance)<=0) and (Number(yDistance)>=0)) {
direction = Number(-1*90*(xDistance/normalise))+90;
} else if ((Number(xDistance)<=0) and (Number(yDistance)<=0)) {
direction = Number(-1*90*(yDistance/normalise))+180;
} else {
direction = Number(90*(xDistance/normalise))+270;
}
// set direction of needle and bullet
needle._rotation = direction;
}
}
face.onRollOut = function(){
mouseTarget.stopDrag();
}
Heres a link to the current SWF:
http://www.joshuajonah.com/compass.swf
Heres a link to the current SFLA:
http://www.joshuajonah.com/compass.fla