# How to make a different width image carousel?

**URL:** <https://forum.kirupa.com/t/how-to-make-a-different-width-image-carousel/308796>\
**Category:** Uncategorized\
**Created:** [April 30, 2010, 8:52am UTC](https://forum.kirupa.com/t/how-to-make-a-different-width-image-carousel/308796 "2010-04-30T08:52:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kenchan7727](https://avatars.discourse-cdn.com/v4/letter/k/41988e/32.png) [@kenchan7727](https://forum.kirupa.com/u/kenchan7727)\
**Post date:** [April 30, 2010, 8:52am UTC](https://forum.kirupa.com/t/how-to-make-a-different-width-image-carousel/308796/1 "2010-04-30T08:52:45Z")

</div>

I create the horizontal image carousel and mod the code from

[http://www.republicofcode.com/tutorials/flash/as3gridgallery/4.php](http://www.republicofcode.com/tutorials/flash/as3gridgallery/4.php)

In this page, they show how to add space between each image. However, I have a different size of width of images so I wonder how can I align all the image with equally spaces between each.

# Here is the code to add space;

function callThumbs():void{  
for (var i:Number = 0; i \< my\_total; i++){

```
  var thumb_url = my_images*.@THUMB;;
  var thumb_loader = new Loader();
  thumb_loader.load(new URLRequest(thumb_url));

```

thumb\_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, thumbLoaded);

**thumb\_loader.x = my\_thumb\_width\*i;**

```
  }
  }

```

=======================================================  
By the way, right now all the images load from XML file and have the same width from the parent node. How could I disable that to 0 and use each image width instead. Then add some space both left and right with AS3?

Any Ideas?
