Quick Flash AS3 snippets from a self-taught programmer wannabe.
x -= (x - mouseX) / speed;
y -= (y - mouseY) / speed;
fairplay, thats pretty neat!
This comment has been removed by the author.
Movement 2 result should be 4.44. But that doesn't really matter as it's still moving towards 3. Also in your example, you should keep xmouse constant as the object is moving towards it. Then it'll be easier to see how it works.The equation may be translated to:position change = distance difference / time
Hi, I am trying to create a movieclip menu that follows the mouse but stops at a distance or when the mouse rolls over it. please what line of code do I insert in? thanks