Skip to content

Instantly share code, notes, and snippets.

@GSimas
Created June 21, 2015 04:09
Show Gist options
  • Save GSimas/f4dee9794902bc43cd64 to your computer and use it in GitHub Desktop.
Save GSimas/f4dee9794902bc43cd64 to your computer and use it in GitHub Desktop.
Action Script 2.0 Function for MouseEvent - Object following mouse
onClipEvent (load) {
_x = 0;
_y = 0;
speed = 5;
}
onClipEvent (enterFrame) {
endX = _root._xmouse;
endY = _root._ymouse;
_x += (endX-_x)/speed;
_y += (endY-_y)/speed;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment