# AS2/XML gallery stops working correctly when loaded into main file

**URL:** <https://forum.kirupa.com/t/as2-xml-gallery-stops-working-correctly-when-loaded-into-main-file/303334>\
**Category:** flash\
**Created:** [January 18, 2010, 10:47pm UTC](https://forum.kirupa.com/t/as2-xml-gallery-stops-working-correctly-when-loaded-into-main-file/303334 "2010-01-18T22:47:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![manthonyh](https://avatars.discourse-cdn.com/v4/letter/m/c57346/32.png) [@manthonyh](https://forum.kirupa.com/u/manthonyh)\
**Post date:** [January 18, 2010, 10:47pm UTC](https://forum.kirupa.com/t/as2-xml-gallery-stops-working-correctly-when-loaded-into-main-file/303334/1 "2010-01-18T22:47:26Z")

</div>

Hi everybody and thanks again for taking time to read through this.

I am new to Flash and am tying to build my portfolio with it. I followed the Kirupa tutorial on XML picture gallery and when I test it in Flash it works fine. However when I load the gallery swf into my main swf only the description text button will jump according to the next/previous commands of the buttons - but only the first image is displayed. [(check out the error under the painting tab)](http://imageinlife.com/potest0115.html)

My first thought is that it must be the buttons, but the text is jumping correctly so it can’t be that - right?  
The only other thing I can think of is the loadMovie section of the code, maybe I have to specify it more or something… I have no idea.

function nextImage() {

```
if (p&lt;(total-1)) {

    p++;
    if (loaded == filesize) {

        [COLOR=Red]picture._alpha = 0;
        picture.loadMovie(image[p],1);[/COLOR]
        desc_txt.text = description[p];
        date_txt.text = date[p];
        xy_txt.text = xy[p];
        price_txt.text = price[p];
        picture_num();

    }

}

```

};  
function prevImage() {

```
if (p&gt;0) {

    p--;
   [COLOR=Red] picture._alpha = 0;
    picture.loadMovie(image[p],1);[/COLOR]
    desc_txt.text = description[p];
    date_txt.text = date[p];
    xy_txt.text = xy[p];
    price_txt.text = price[p];
    picture_num();

}

```

};  
function firstImage() {

```
if (loaded == filesize) {

    [COLOR=Red]picture._alpha = 0;
    picture.loadMovie(image[0],1);[/COLOR]
    desc_txt.text = description[0];
    date_txt.text = date[0];
    xy_txt.text = xy[0];
    price_txt.text = price[0];
    picture_num();

}

```

I tried everything (without really knowing what damage I am possible doing) like omitting the [COLOR=Red],1[/COLOR] and so forth but nothing seems to work - or work in the individual movie test but not when loaded into the other movie.

Any help would be deeply appreciated, and mentioned on my site.

Michael
