Resizing different sized images

Hi there!
Ok im new here and to Flash programing… so its safe to assume that i know close to zip.
:h:
I’ve based it on the “XML and Flash Photo Gallery” tutorial by one of the guys on here. The centering bit i looked at another forums post.

I use a MC(bg) and inside that another MC(photo)
two buttons “pervious_btn” “next_btn”
I load my images via “images.xml”
It loads everything and it centers the 1st image(276x184), but it keeps the 1st image coordinates for the rest which is 640x480 and 480x640… thats where the mess comes in. It doesnt center the next image.

I know lightbox is there and easy to use but I dont want to because of the settings you have to set on the Adobe site for it to allow access and all that… besides i really like Flash!

Is there a way to perhaps “reset” the MC, or coordinates before loading the next image???

Anyone willing to help?!

I would really appreciate it!

Regards,

Reinhardt

The code:

stop();

var imageHolder:MovieClip;
var mcLoader:MovieClipLoader = new MovieClipLoader();
var mcListener:Object = new Object();
mcListener.onLoadInit = function ()
{bg.imageHolder._x = (Stage.width - bg.imageHolder._width)/2;
bg.imageHolder._y = (Stage.height - bg.imageHolder._height)/2;}
{bg.width = stage.stageWidth;
bg.height = stage.stageHeight;}

//pasted code//
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()

{bg.imageHolder.unloadMovie;
nextImage();};

/////////////////////////////////////
p = 0;
this.onEnterFrame = function() {

filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {

preloader.preload_bar._xscale = 100*loaded/filesize;

} else {

preloader._visible = false;
if (bg.imageHolder._alpha<100) {

bg.imageHolder._alpha += 10;

}

}

};
function nextImage() {

if (p<(total-1)) {

p++;
if (loaded == filesize) {

bg.imageHolder._alpha = 0;
bg.imageHolder.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();

}

}

}
function prevImage() {

if (p>0) {

p–;
bg.imageHolder._alpha = 0;
bg.imageHolder.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();

}

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

function picture_num() {current_pos = p+1;
pos_txt.text = current_pos+" / "+total;}

//pasted code//

mcLoader.addListener(mcListener);
myLoad(“images/img1.jpg”);

function myLoad(imgToLoad)
{
imageHolder = bg.createEmptyMovieClip(“imageHolder”, 2000);
mcLoader.loadClip(imgToLoad, imageHolder);
}