I am using this function to attach a movieclip to the mouse (with easing). But when the mouse goes out of the swf inside the browser, on all sides except the left, the movieclip jerks to the utmost left position it can have in the game. I would like it to stay where it is. How to?
mousecontrol = function() {
mx=_root._xmouse;
if (mx<plat2._x) {
dx=plat2._x-mx;
}
else {
dx=mx-plat2._x;
}
moveSpeedx=dx/3;
if (mx<plat2._x) {
plat2._x = plat2._x-moveSpeedx;
}
else {
plat2._x = plat2._x+moveSpeedx;
}
if (plat2._x<70)
{plat2._x=70}
if (plat2._x>600)
{plat2._x=600}
}