# Img gallery XMLList issue : (

**URL:** <https://forum.kirupa.com/t/img-gallery-xmllist-issue/294186>\
**Category:** flash\
**Created:** [August 10, 2009, 5:37pm UTC](https://forum.kirupa.com/t/img-gallery-xmllist-issue/294186 "2009-08-10T17:37:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Atroxe](https://avatars.discourse-cdn.com/v4/letter/a/f1d935/32.png) [@Atroxe](https://forum.kirupa.com/u/Atroxe)\
**Post date:** [August 10, 2009, 5:37pm UTC](https://forum.kirupa.com/t/img-gallery-xmllist-issue/294186/1 "2009-08-10T17:37:29Z")

</div>

So, I’ve steered my boat in to the world of Flash and AS3, indeed very funny and creative, but i comes along with a heap of problems.

I’ve built a basic gallery to display images and some text content, which can be seen [http://cherrypop.000hosted.com/Tove/Tove-Info.htm](http://cherrypop.000hosted.com/Tove/Tove-Info.htm) \<- There.

The basic mechanics of this is that there is a TV-screen looping through images from an XMLList, and a navigational component in the bottom where you can scroll through lists of images (please try the gallery to understand).

As long as i only load one set of images, it works fine, but when i load two sets, i get problems.

scrolling one way works fine, but i can’t scroll “backwards” (subtracting from the XMLList), it just rolls out in to nothingness without loading new images.

Vital code:

```auto
function prevList(e:MouseEvent):void
        {
            animOutRTL = new Tween(sliderThumbs_mc, "x", Strong.easeIn, 26.7, -700, 2, true);
            animOutRTL.addEventListener(TweenEvent.MOTION_FINISH, animListRTL);
        }

```

This is the function tied to the “previous list”-button.  
It causes the set of images to roll away, and adds an eventlistener for next function;

```auto
        function animListRTL(e:TweenEvent):void
        {
            animInRTL = new Tween(sliderThumbs_mc, "x", Strong.easeOut, 700, 26.7, 2, true);
            
                if (currentList < listImages.length() - 1)
                {
                    currentList--;
                    updateList(currentList);
                } else {
                    currentList = 0;
                    updateList(currentList);
                }
        
                if (currentList == 0)
                {
                    currentList = listImages.length();
                    currentList--;
                }
            updateList(currentList);
        }

```

Which is supposed to animate the list back again, but having updated the imageloaders with a new set of images, if the current list is 0, it should go to listImages.length - 1 (don’t know why i had to subtract one …), and if the current list is more then 0 it should subtract 1 casing the list to load the previous one.

I would be glad if anyone helped me out, and thanks for reading it, it’s a bit messy and stuff… but i can’t find my way out here …
