# Make an thumbnail scroller loop?

**URL:** <https://forum.kirupa.com/t/make-an-thumbnail-scroller-loop/228276>\
**Category:** Uncategorized\
**Created:** [June 6, 2007, 4:59pm UTC](https://forum.kirupa.com/t/make-an-thumbnail-scroller-loop/228276 "2007-06-06T16:59:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stu\_t](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@stu\_t](https://forum.kirupa.com/u/stu_t)\
**Post date:** [June 6, 2007, 4:59pm UTC](https://forum.kirupa.com/t/make-an-thumbnail-scroller-loop/228276/1 "2007-06-06T16:59:56Z")

</div>

I have this scroller of thumbnail images, but it stops scrolling when the images run out!

is there a way to make it so it loops around and around???

here is the code i used to make it scroll,

```auto
function thumbNailScroller() {
	// thumbnail code! 
	this.createEmptyMovieClip("tscroller", 1000);
	scroll_speed = 10;
	tscroller.onEnterFrame = function() {
		if ((_root._ymouse>=thumbnail_mc._y) && (_root._ymouse<=thumbnail_mc._y+thumbnail_mc._height)) {
			if ((_root._xmouse>=(hit_right._x-40)) && (thumbnail_mc.hitTest(hit_right))) {
				thumbnail_mc._x -= scroll_speed;
			} else if ((_root._xmouse<=(hit_left._x+40)) && (thumbnail_mc.hitTest(hit_left))) {
				thumbnail_mc._x += scroll_speed;
			}
		} else {
			delete tscroller.onEnterFrame;
		}
	};
}
function thumbnails_fn(k) {
	thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
	tlistener = new Object();
	tlistener.onLoadInit = function(target_mc) {
		target_mc._x = hit_left._x+(target_mc._width+5)*k;
		target_mc.pictureValue = k;
		target_mc.onRelease = function() {
			p = this.pictureValue-1;
			nextImage();
		};
		target_mc.onRollOver = function() {
			this._alpha = 50;
			thumbNailScroller();
		};
		target_mc.onRollOut = function() {
			this._alpha = 100;
		};
	};
	image_mcl = new MovieClipLoader();
	image_mcl.addListener(tlistener);
	image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
}

```
