I’m using the codebase from the Flash/XML Gallery tutorial posted on this website – [COLOR=#800080]http://www.kirupa.com/developer/mx2004/xml_flash_photogallery.htm[/COLOR]
Because my images are not all of a uniform size, I need to dynamically find out what the loaded image sizes are and then based on the stage size, center them on my stage. I understand in principle how this is done – [mcInstanceName]._width, [mcInstanceName]._height. I then subtract these values from the stage w/h and then divide by two.
My issues is that using the codebase at the tutorial link above, it’s seems that I can only access the empty movie clip’s properties in the onEnterFrame event handler. I thought I could access the empty movie clip’s properties anytime the prevImage() & nextImage() functions were call. I trace the values at those point in the code and get “0”
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
// MY ADJUSTMENTS HERE
imgH = picture._height;
imgW = picture._width;
picture._x = (Stage.width-imgW)/2;
picture._y = (Stage.height-imgH)/2;
}
}
The code is not returning the _width & _height values in order to set my _x & _y properties. Any pointers, I’d greatly appreciate.
-MP