Enhancement to Image Panning Effect

I recently took the “interactive image panning” tutorial: http://www.kirupa.com/developer/flash8/interactive_image_pan.htm

I would like to enhance this effect by having the image return to center after it is moused off of. Currently, it will just stay where you left off. It would be neat if it returned at the same speed as it pans. I would love to see if this can be done for a client. Here is the code from the tutorial:


this.onMouseMove = function() { 
constrainedMove(bg_mc, 4, 1); 
}; 
function constrainedMove(target:MovieClip, speed:Number, dir:Number) { 
var mousePercent:Number = _xmouse/Stage.width; 
var mSpeed:Number; 
if (dir == 0) { 
mSpeed = 1-mousePercent; 
} else { 
mSpeed = mousePercent; 
} 
target.destX = Math.round(-((target._width-Stage.width)*mSpeed)); 
target.onEnterFrame = function() { 
if (target._x == target.destX) { 
delete target.onEnterFrame; 
} else { 
target._x += Math.ceil((target.destX-target._x)*(speed/100)); 
} 
}; 
}