# Scrolling image controlling speed w/mouse

**URL:** <https://forum.kirupa.com/t/scrolling-image-controlling-speed-w-mouse/15388>\
**Category:** Uncategorized\
**Created:** [March 13, 2003, 5:54pm UTC](https://forum.kirupa.com/t/scrolling-image-controlling-speed-w-mouse/15388 "2003-03-13T17:54:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![webworks](https://avatars.discourse-cdn.com/v4/letter/w/74df32/32.png) [@webworks](https://forum.kirupa.com/u/webworks)\
**Post date:** [March 13, 2003, 5:54pm UTC](https://forum.kirupa.com/t/scrolling-image-controlling-speed-w-mouse/15388/1 "2003-03-13T17:54:21Z")

</div>

Hi everyone 🙂

I followed infinite menu tutorial somewhat successfully but not quite for this effect:  
[http://fenwickplantation.com/scrolling\_gallery\_fenwick2.html](http://fenwickplantation.com/scrolling_gallery_fenwick2.html)

The graphic is 2400 pixels wide and the movie is 600 pixels wide. But, for some reason it’s skipping, and not showing the full image:  
[http://fenwickplantation.com/collage\_2400.jpg](http://fenwickplantation.com/collage_2400.jpg) What do I need to change in the code to make it roll continuously showing everything? I’m just clueless right now :crazy:

Here’s the fla:  
[http://fenwickplantation.com/scrolling\_gallery\_fenwick2.fla](http://fenwickplantation.com/scrolling_gallery_fenwick2.fla)

Any help so greatly appreciated:)

```auto
onClipEvent (load)
{
   xcenter=300;
   speed=1/50;
}
onClipEvent (enterFrame)
{
   var distance=_root._xmouse-xcenter;
   _x+=(distance*speed);
}
onClipEvent (enterFrame)
{
   var distance=_root._xmouse-xcenter;
   _x+=(distance*speed);
   if (_x > 0) _x=-300;
   if (_x < -300) _x=0;
}

```

oops, forgot to paste code

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 13, 2003, 8:12pm UTC](https://forum.kirupa.com/t/scrolling-image-controlling-speed-w-mouse/15388/2 "2003-03-13T20:12:07Z")

</div>

```auto
onClipEvent (load) {
	xcenter = 300;
	speed = 1/50;
	this._x = -2400;
}
onClipEvent (enterFrame) {
	var distance = _root._xmouse-xcenter;
	_x>0 ? _x = -2400 : _x<-2400 ? _x = 0 : _x += (distance*speed);
}

```

=)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 13, 2003, 8:17pm UTC](https://forum.kirupa.com/t/scrolling-image-controlling-speed-w-mouse/15388/3 "2003-03-13T20:17:33Z")

</div>

You rock! BIG thanks! :sure:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 13, 2003, 8:18pm UTC](https://forum.kirupa.com/t/scrolling-image-controlling-speed-w-mouse/15388/4 "2003-03-13T20:18:31Z")

</div>

no problem 😉
