I am using the following code to pan an image based on the mouse position. All works fine except I want the image to slide to the correct position with easing if you move the mouse off of the stage and then reenter the mouse in a different position from when you left. Right now, what it does is snaps to the mouse instead of sliding to it.
Can somebody take a look or give me an idea as to how I can make it slide to the mouse from the images current position with easing instead of snapping to it? Any help is greatly appreciated.Code:_root.createEmptyMovieClip("holder", 1);
holder.attachMovie("image", "image", 1);
holder._x = 0;
holder._y = 0;
slope = (Stage.width - holder._width)/Stage.width;
vertSlope = (Stage.height - holder._height)/Stage.height;
curXPos = holder._x;
curYPos = holder._y;
_root.onMouseMove = function(){
_root.onEnterFrame = function(){
_root.holder._x = slope*_xmouse;
_root.holder._y = vertSlope*_ymouse;
curXPos = _root.holder._x = slope*_xmouse;
curYPos = _root.holder._y = vertSlope*_ymouse;
trace("x:" + curXPos);
trace("y:" + curYPos);
delete(this.onEnterFrame);
}
}
