# Xml gallery - horizontal placement - different widths?

**URL:** https://forum.kirupa.com/t/xml-gallery-horizontal-placement-different-widths/256264
**Category:** Uncategorized
**Created:** [April 1, 2008, 2:23pm UTC](https://forum.kirupa.com/t/xml-gallery-horizontal-placement-different-widths/256264 "2008-04-01T14:23:50Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![justinianmoore](https://avatars.discourse-cdn.com/v4/letter/j/5daacb/32.png) [@justinianmoore](https://forum.kirupa.com/u/justinianmoore)
#### Post date: [April 1, 2008, 2:23pm UTC](https://forum.kirupa.com/t/xml-gallery-horizontal-placement-different-widths/256264/1 "2008-04-01T14:23:50Z")

</div>

Hey, I’m trying to make a scrolling gallery where you move your mouse left and it moves right etc, but i need to solve a small problem this is where i’m getting stuck first.

I want to display my images (that all have different widths) horizontally and next to each other. Tried a few things that didnt work.

**here is the xml:**

```auto
<select>
    <option photo="photos/lunch.jpg"></option>
    <option photo="photos/tentglow.jpg"></option>
    <option photo="photos/axel.jpg"></option>
    <option photo="photos/tent.jpg"></option>
    <option photo="photos/sunset.jpg"></option>
    <option photo="photos/storm.jpg"></option>
</select>

```

\*\*here is my code: \*\*

```auto
var myXML:XML = new XML();
var loader:MovieClipLoader = new MovieClipLoader();
loader.addListener(this);
myXML.ignoreWhite = true;
myXML.load("gallery.xml");
myXML.onLoad = function(success) {
    if (success) {
        var gallery:XMLNode = myXML.firstChild;
        for (i=0; i<gallery.childNodes.length; i++) {
            image = gallery.childNodes*.attributes.photo;
            var row = 116;
            createdimage = thumbsHolder_mc.attachMovie("emptyimg", "emptyimg"+i, thumbsHolder_mc.getNextHighestDepth());
            createdimage._y = 50;
            loader.loadClip(image,createdimage);
            if(i>0){
            createdimage._x = eval(thumbsHolder_mc["emptyimg"+(i-1)])._x+eval(thumbsHolder_mc["emptyimg"+i])._width;
            }
            
        }
    }
};

```

If someone you finds all this stuff really easy could help me that would be awesome!  
I’m new to all this …

thanks
