# XML photo gallery issues

**URL:** https://forum.kirupa.com/t/xml-photo-gallery-issues/163215
**Category:** flash
**Created:** [September 20, 2005, 6:21pm UTC](https://forum.kirupa.com/t/xml-photo-gallery-issues/163215 "2005-09-20T18:21:21Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![losse](https://avatars.discourse-cdn.com/v4/letter/l/9d8465/32.png) [@losse](https://forum.kirupa.com/u/losse)
#### Post date: [September 20, 2005, 6:21pm UTC](https://forum.kirupa.com/t/xml-photo-gallery-issues/163215/1 "2005-09-20T18:21:21Z")

</div>

Hi gang  
I am building an XML photo gallery, inspired by the tutorial on this site. It works fine, however, I am coming across an issue when I want to have my thumbnails wrap on the flash movie rather than running off the stage and unvisible to the user.

I was wondering if there is something I can do to the actionscript or the flash file to modify it so that as more images get added to the stage, either the thumbnails wrap and/or a scroll bar appears…

Here is the code

XML file:

```auto
 <gallery>
<image title="Image 1" main="one.jpg" thmb="1thumb.jpg"/> 
<image title="Image 2" main="two.jpg" thmb="2thumb.jpg"/> 
<image title="Image 3" main="three.jpg" thmb="3thumb.jpg"/>
<image title="Image 4" main="four.jpg" thmb="4thumb.jpg"/>
<image title="Image 5" main="five.jpg" thmb="5thumb.jpg"/>
<image title="Image 6" main="six.jpg" thmb="6thumb.jpg"/>
</gallery>

```

* * *

Actionscript in Flash

```auto
 myPhoto = new XML();
myPhoto.ignoreWhite = true;
myPhoto.load("xmlphoto.xml");
myPhoto.onLoad = function(success) {
numimages = this.firstChild.childNodes.length;
spacing = 50;
for (i=0; i<numimages; i++) {
picHolder = this.firstChild.childNodes*;
thumbHolder = thumbnails.createEmptyMovieClip("thumbnail"+i, i);
thumbHolder._x = i*spacing;
thumbHolder.title = picHolder.attributes.title;
thumbHolder.main = picHolder.attributes.main;
thumbLoader = thumbHolder.createEmptyMovieClip("thumbnail_image"+i, i);
thumbLoader.loadMovie(picHolder.attributes.thmb);
//create new movie and then load the thumbnails into it.
thumbHolder.onRelease = function() {
loader.loadMovie(this.main);
title_txt.text = this.title;
};
}
};

```

* * *

On the stage I have 2 movie clips with instance names of “loader” (which populates the image" “thumbnails” (which populates the thumbnails) and a dynamic textfield for the image title.

Thanks. Greatly appreciated.
