Tuesday, 22 September 2009

follow the mouse with ease.

// action script 2


onClipEvent (load) {
_x = 0;
_y = 0;
speed = 5;
}
//we can change the speed of the mouse here from 5 to 10
onClipEvent (enterFrame) {
endX = _root._xmouse;
endY = _root._ymouse;
_x += (endX-_x)/speed;
_y += (endY-_y)/speed;
}

//have fun

No comments: