# MouseListener/Order Question for Gallery

**URL:** <https://forum.kirupa.com/t/mouselistener-order-question-for-gallery/246393>\
**Category:** flash\
**Created:** [December 10, 2007, 8:36pm UTC](https://forum.kirupa.com/t/mouselistener-order-question-for-gallery/246393 "2007-12-10T20:36:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![function4](https://avatars.discourse-cdn.com/v4/letter/f/dc4da7/32.png) [@function4](https://forum.kirupa.com/u/function4)\
**Post date:** [December 10, 2007, 8:36pm UTC](https://forum.kirupa.com/t/mouselistener-order-question-for-gallery/246393/1 "2007-12-10T20:36:07Z")

</div>

Hey! So I have a multi-gallery picture viewer that also has thumbnails. I’m trying to implement a scroll bar for viewing the different albums. Posted here are two sections of code, when the second is above the first, the scroll bar doesn’t work but the pictures load. And when then the second is below the first, the pictures don’t load, and the scroll bar works!

first code

```php

onEnterFrame = function () {
 (this.menu_mc.thumb_menu.destX-this.menu_mc.thumb_menu._x)/3;
    hover.txt._width = hover.txt.textWidth+10;
    hover.bg._width = hover.txt._width+10;
    loaded = holder.getBytesLoaded();
    filesize = holder.getBytesTotal();
    if (filesize>100) {
      (preloader stuff)
            if (bg_mc.bg._width>destWidth) {
                info_mc._alpha += (info_mc.destAlpha-info_mc._alpha)/5;
                if (holder._alpha<100) {
                    holder._alpha += 5;
                }
            } else {
                info_mc._alpha = 0;
                info_mc._destAlpha = 0;
            }
        }
    }

};

```

```php

onEnterFrame = function () {
    scrollRatio = albumScroll._height/scrollBar._height;
    ratio = (albumScroll._height+5-scrollBar._height)/(scrollBar._height-scrollBttn._height);
    if (albumScroll._height+5>scrollBar._height) {
        destScroll = ((-scrollBttn._y+albumScroll.originY)*ratio)+albumScroll.originY;
        albumScroll._y += Math.round((destScroll-albumScroll._y)/scrollTween);
    }

}

```

I’m not sure what is causing this conflict… I’ve been moving stuff around for an hour and can’t seem to see what the error is. Anyone have a clue?
