# IMAGE: Idle Scroll

**URL:** <https://forum.kirupa.com/t/image-idle-scroll/116086>\
**Category:** Uncategorized\
**Created:** [July 14, 2004, 2:19pm UTC](https://forum.kirupa.com/t/image-idle-scroll/116086 "2004-07-14T14:19:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SmileyGladhand](https://avatars.discourse-cdn.com/v4/letter/s/a9a28c/32.png) [@SmileyGladhand](https://forum.kirupa.com/u/SmileyGladhand)\
**Post date:** [July 14, 2004, 2:19pm UTC](https://forum.kirupa.com/t/image-idle-scroll/116086/1 "2004-07-14T14:19:53Z")

</div>

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 &gt; 0) _x=-1950;
 if (_x &lt; -1950) _x=0;
 }
 }

```

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

```
 Thanks
```
