IMAGE: Idle Scroll

Hi,

I’m using the following code to continuously scroll an image. I want to keep the mouseover but I need a way to make it scroll at an idle speed when the mouse isn’t over the image. I’d greatly appreciate any help.

 onClipEvent (load)
 {
 mouseOn = false;
 xcenter=600;
 speed=1/10;
 }
 
 on(rollOver)
 {
 mouseOn = true;
 }
 
 on(rollOut)
 {
 mouseOn = false;
 }
 
 onClipEvent (enterFrame)
 {
 if(mouseOn)
 {
 var distance=_root._xmouse-xcenter;
 _x+=(distance*speed);
 if (_x > 0) _x=-1950;
 if (_x < -1950) _x=0;
 }
 }

I also noticed the image jumps to the left when the mouse is over it. Any ideas on that?

 Thanks