Help: Image Panning

I followed everything stated in the tutorial. The tutorial have the left and right panning. Now, I also want to have the up and down panning at the same time. I did it already but panning turned out not smooth. My code is…

this.onMouseMove = function() {
constrainedMove(bg_mc, 4, 1);
};
function constrainedMove(target:MovieClip, speed:Number, dir:Number) {
var mousexPercent:Number = _xmouse/Stage.width;
var mouseyPercent:Number = _ymouse/Stage.width;
var mxSpeed:Number;
var mSpeed:Number;
if (dir == 1) {
mxSpeed = mousexPercent;
} else {
mxSpeed = 1-mousexPercent;
}
if (dir == 1) {
mySpeed = mouseyPercent;
} else {
mySpeed = 1-mouseyPercent;
}
target.destY = Math.round(-((target._width-Stage.width)mySpeed));
target.onEnterFrame = function() {
if (target._y == target.destY) {
delete target.onEnterFrame;
} else {
target._y += Math.ceil((target.destY-target._y)
(speed/100));
}
target.destX = Math.round(-((target._width-Stage.width)mxSpeed));
target.onEnterFrame = function() {
if (target._x == target.destX) {
delete target.onEnterFrame;
} else {
target._x += Math.ceil((target.destX-target._x)
(speed/200));
}
};
};
}

and here’s the swf file.

if you have any suggestions or anything please let me see the code or the fla/swf file… thanks :grin: