Photogallery+thumbnail tutorial related

Hi Everyone,

I have a question regarding the photogallery tutorial on this site.

Currently, all tutorials related to it (including adding of thumbnails) is written in such a manner that they assume all photos would be of equal size ie 300x200.

However, I do not have any such luxory and am stuck as I am not able to get it to work here.

The code is more or less related to the following -

We are doing a picture.loadMovie() to load the external jpeg.

Now, how do we make sure it’s always in the center and has maxWidth as 300 and maxHeight as 200? ie, if width > 300 then width = 300 and height = proportionate to 200
and so on?

I am not able to capture the height and width of the “picture”

It keeps coming as 0.

Please help.

Thanks,
Mandy.

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

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 (picture._alpha<100) {
picture._alpha += 10;
}
}
};