Actionscript 2.0 - flip horizontal when mouse direction changes

I have tried the following code to make a movie clip (car_mc) follow the mouse and to flip horizontally when the mouse changes direction. Some of it works well but the flip is unstable. I have also tried using -1 for both flips. Any suggestions as to what I am doing wrong? Thanks.

//check horizontal direction of moving mouse
checkX = function (dx, oldVal, newVal) {
if (oldVal<newVal) {
trace(“moving right”);
car_mc._xscale*=1;
}
else if (oldVal>newVal) {
trace(“moving left”);
car_mc._xscale*=-1;
}
return newVal;
};
this.watch(“xdir”, checkX);
this.watch(“ydir”, checkY);
this.onMouseMove = function() {
xdir = _xmouse;
ydir = _ymouse;
};
//make car follow mouse, and change direction with mouse
car_mc.onEnterFrame = function() {
var xMouse = _root._xmouse;

if(Math.abs(xMouse - this._x) < 1) {
this._x = xMouse;
}
else {
this._x -= (this._x-xMouse) / 6;
}
}