Detect Mouse Stop?

Folks, I have the following code on a movie clip which follows the mouse fine on the x axis, but does anyone how I can modify it to detect when the mouse has stopped, then the object (a bird) will then stop it’s running action?


onClipEvent (load) {
	_x = 0;
	speed = 5;
}
onClipEvent (enterFrame) {
	endX = _root._xmouse;
	_x += (endX-_x)/speed;
	
	checkX =  function (dx,  oldVal, newVal)  { 
	if (oldVal<newVal)  {
		this._xscale=+100;

	} else  if (oldVal>newVal)  {
		this._xscale=-100;
	} 
	return  newVal;
};

	this.watch("xdir",  checkX);
	this.onMouseMove  = function()  { 
	xdir =  _root._xmouse;
};
	
}

Try to add this to your enterFrame event…

if(oldX==_root._xmouse) {
    trace("mouse didnt move");
}
oldX = _root._xmouse;