Friday, July 2, 2010

MC to follow Cursor in AS2

Smooth MC follow to Cursor in Action Script 2

Just add below code in your cursor movie clip

_root.Cursor_mc.enterFrame = function(){
_root.yChange = Math.round(_root._ymouse-this._y);
_root.xChange = Math.round(_root._xmouse-this._x);
_root.yMove = Math.round(_root.yChange/5);
_root.xMove = Math.round(_root.xChange/5);
this._x += _root.xMove;
this._y += _root.yMove;
}



No comments: