# Image gallery x positioning

**URL:** <https://forum.kirupa.com/t/image-gallery-x-positioning/297615>\
**Category:** flash\
**Created:** [October 6, 2009, 1:58am UTC](https://forum.kirupa.com/t/image-gallery-x-positioning/297615 "2009-10-06T01:58:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![NiallTL](https://avatars.discourse-cdn.com/v4/letter/n/d26b3c/32.png) [@NiallTL](https://forum.kirupa.com/u/NiallTL)\
**Post date:** [October 6, 2009, 1:58am UTC](https://forum.kirupa.com/t/image-gallery-x-positioning/297615/1 "2009-10-06T01:58:48Z")

</div>

Hallo.

I’m creating a mouse-movement controlled image gallery for a portfolio website, and I’m wondering how to position the loaded images so they’re aligned next to each other. I can’t just do \_x+=\_width in onLoadInit, as there is more than one image.  
Here’s my code so far:

```auto
dir = "emotive/thumb/";
arr = ["12.jpg", "emma.jpg", "jimmyjohanne.jpg", "ninavandyk.jpg"];
var movieClip:MovieClip = createEmptyMovieClip("movieClip", 0);
var listenerObj:Object = new Object();
listenerObj.onLoadProgress = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
    var percent:Number = Math.round(bytesLoaded*100/bytesTotal);
};
listenerObj.onLoadInit = function(target_mc:MovieClip):Void {
};
var movieClipLoader:MovieClipLoader = new MovieClipLoader();
movieClipLoader.addListener(listenerObj);
for (i=0; i<arr.length; i++) {
    fr = _root.createEmptyMovieClip("f"+i, _root.getNextHighestDepth());
    movieClipLoader.loadClip(dir+arr*,fr);
}

```

arr is the array of image filenames, I’ll eventually make this dynamic by passing a variable from PHP to Flash.

Any help is appreciated c:
