# Component alignment?

**URL:** <https://forum.kirupa.com/t/component-alignment/237855>\
**Category:** flash\
**Created:** [September 4, 2007, 6:29pm UTC](https://forum.kirupa.com/t/component-alignment/237855 "2007-09-04T18:29:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BuG56](https://avatars.discourse-cdn.com/v4/letter/b/c57346/32.png) [@BuG56](https://forum.kirupa.com/u/BuG56)\
**Post date:** [September 4, 2007, 6:29pm UTC](https://forum.kirupa.com/t/component-alignment/237855/1 "2007-09-04T18:29:23Z")

</div>

Hey all, I’ve got a little problem.

My overall project is to create a gallery app (sort of like the mac album browser app) Anyway, all images are loaded from an xml file:

```auto

<imageSet>
    <image>
        <S>img1.jpg</S>
        <A>IMAGE ONE ALT</A>
        <T>IMAGE ONE TITLE</T>
     </image>
         <image>
        <S>img2.jpg</S>
        <A>IMAGE TWO ALT</A>
        <T>IMAGE TWO TITLE</T>
     </image>
         <image>
        <S>img3.jpg</S>
        <A>IMAGE THREE ALT</A>
        <T>IMAGE THREE TITLE</T>
     </image>
         <image>
        <S>img4.jpg</S>
        <A>IMAGE FOUR ALT</A>
        <T>IMAGE FOUR TITLE</T>
     </image>
         <image>
        <S>img5.jpg</S>
        <A>IMAGE FIVE ALT</A>
        <T>IMAGE FIVE TITLE</T>
     </image>
         <image>
        <S>img6.jpg</S>
        <A>IMAGE SIX ALT</A>
        <T>IMAGE SIX TITLE</T>
     </image>
</imageSet>

```

S = source  
A = alternate text  
T = title

pretty straightforward, I import it into my movie succsesfully and put the info into three arrays :

\_root.srcArray  
\_root.altArray  
\_root.titleArray

This works fine, the next step is to use the loader component to display these images. this is done here:

```auto

function populateScreen()
    {
        for (j=0; j<imageCount; j++)
        {
            import mx.controls.Loader;
            var curOBJ = createClassObject(Loader, "container"+j, j, {contentPath:_root.srcArray[j]});
            setPos(j,curOBJ)
        }
    }

```

my problem occurs here:

```auto

function setPos(index,object)
    {
     object._x=500
     object._y=200
    }

```

The reassignment of the \_x and \_y are visually changed, but for some reason it is towards the bottom and not the middle like it should be. (1000x400px document). Something is up with the component… can anyone help me?

Thank you!
