# Using the Photo Gallery Thumbnail Scroll Code for independent movieclips

**URL:** <https://forum.kirupa.com/t/using-the-photo-gallery-thumbnail-scroll-code-for-independent-movieclips/228848>\
**Category:** flash\
**Created:** [June 12, 2007, 12:43am UTC](https://forum.kirupa.com/t/using-the-photo-gallery-thumbnail-scroll-code-for-independent-movieclips/228848 "2007-06-12T00:43:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cyan](https://avatars.discourse-cdn.com/v4/letter/c/278dde/32.png) [@cyan](https://forum.kirupa.com/u/cyan)\
**Post date:** [June 12, 2007, 12:43am UTC](https://forum.kirupa.com/t/using-the-photo-gallery-thumbnail-scroll-code-for-independent-movieclips/228848/1 "2007-06-12T00:43:16Z")

</div>

I’m using the xml gallery vertical scrolling thumbnails code for my portfolio site. But, I have another section in the site that is separate from the gallery section where I want a movieclip to scroll the same way the thumbnails are scrolling (speed, same hit test, etc.) but I’m not sure how to alter the code to simply make a movie clip move the same way. I tried just changing the movieclip name, but it didn’t work. Am I over-thinking it?  
This is the code that is being used for the gallery.

```auto

function thumbNailScroller() {
    // thumbnail code! 
    this.createEmptyMovieClip("tscroller", 1000);
    scroll_speed = 10;
    tscroller.onEnterFrame = function() {
        if ((_root._xmouse>=thumbnail_mc._x) && (_root._xmouse<=thumbnail_mc._x+thumbnail_mc._width)) {
            if ((_root._ymouse>=(hit_right._y-40)) && (thumbnail_mc.hitTest(hit_right))) {
                thumbnail_mc._y -= scroll_speed;
            } else if ((_root._ymouse<=(hit_left._y+40)) && (thumbnail_mc.hitTest(hit_left))) {
                thumbnail_mc._y += scroll_speed;
            }
        } else {
            delete tscroller.onEnterFrame;
        }
    };
}

```
