Repositioning conflict

I have an mc with the following code:

onClipEvent (load)
{
xcenter=495;
speed=1/10;
}
onClipEvent (enterFrame)
{
var distance=_root._xmouse-xcenter;
_x-=(distance*speed);
if (_x > 1410) _x=1410;
if (_x < -400) _x=-420;
}

onClipEvent (enterFrame) {
spd = 8;
this._x += (endX-_x)/spd;
}

On a couple of buttons within the mc, I have code like this:

on (release){
endX = -40;
}

with various endX values. The buttons work perfectly. The sliding of the image (behind a mask) also works perfectly (when the mouse goes right the image slides left)… but, if I press one of the buttons and then try to slide across with the mouse, the movement is severely hampered, so that I can’t move as far or as fast. I have a rough idea of why this is happening, but I haven’t figured out a way to fix it. I’m hoping to launch this site in 8 hours so help is very much appreciated!