Follow an object (mouse click) without decreasing the speed
hello,
i want to make a movie clip follow the mouse while we are pressing the left Button (NOT "be" the mouse ), i end it up with this code but am having a problem,
-the speed of the movie clip decrase by his own, i know that this is happening because of the last two lines, i will be glad if anyone could help me to solve this problem, thanx
onClipEvent (enterFrame) {
onMouseUp = function ()
{
apui = false;
};
onMouseDown = function ()
{
apui = true;
rotateSpeed = 3;
};
if (apui == true)
{
goX = _root._xmouse;
goY = _root._ymouse;
}
else if (apui == false)
{
goX = this._x;
goY = this._y;
}
this._x -= (this._x - this.goX)/20 ;
this._y -= (this._y - this.goY)/20 ;
}
