How to align center the xml loaded images?

Hey,

First of all, thanks for the great information on this website!

I just finished reading and building the Photo Gallery using XML and Flash tutorial.
Now i was editing it a bit to my desire, but im having trouble with positioning.

My external images are all different sizes, and I would like to align them to the horizontal center of my Flash area.

im not a big flash hero, so could use some help please :slight_smile:

Thank you!



function loadXML(loaded) {
    if (loaded) {
        xmlNode = this.firstChild;
        image = [];
        description = [];
        total = xmlNode.childNodes.length;
        for (i=0; i<total; i++) {
            image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
            description* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
        }
        firstImage();
    } 
    else {
        content = "file not loaded!";
    }
}

xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");

/////////////////////////////////////

previous_btn.onRelease = function() {
    prevImage();
};
next_btn.onRelease = function() {
    nextImage();
};

//PRELOADER///////////////////////////////////

p = 0;
this.onEnterFrame = function() {
        if (picture._alpha<100) {
            picture._alpha += 10;
        }
};

//cycling Through Images///////////////////////////////

function nextImage() {
    if (p<(total-1)) {
        p++;
        picture._alpha = 0;    
        picture.loadMovie(image[p], 1);
        desc_txt.text = description[p];
    }
}

function prevImage() {
    if (p>0) {
        p--;
        picture._alpha = 0;
        picture.loadMovie(image[p], 1);
        desc_txt.text = description[p];
    }
}

function firstImage() {
    if (loaded == filesize) {
        picture._alpha = 0;
        picture.loadMovie(image[0], 1);
        desc_txt.text = description[0];
        picture_num();
    }
}