I am using Flash 8 and AS2.
I have been looking and looking, but I cannot find how to have an object follow the mouse at a CONSTANT speed. The code I keep on finding is something like this:
onClipEvent (load) {
_x = 0;
_y = 0;
speed = 5;
}
onClipEvent (enterFrame) {
endX = _root._xmouse;
endY = _root._ymouse;
_x += (endX-_x)/speed;
_y += (endY-_y)/speed;
}
Sadly, the “/speed” part makes the object move slower the closer it gets.
I don’t know if I’m just missing some really simple detail, or some major idea, but I’m pretty sure something as easy as this is possible.
Thanks!