# \[FMX2004\] - Determining Size Of Image Loaded Into Blank MovieClip (Based On Tutorial)

**URL:** <https://forum.kirupa.com/t/fmx2004-determining-size-of-image-loaded-into-blank-movieclip-based-on-tutorial/258852>\
**Category:** flash\
**Created:** [April 28, 2008, 10:23pm UTC](https://forum.kirupa.com/t/fmx2004-determining-size-of-image-loaded-into-blank-movieclip-based-on-tutorial/258852 "2008-04-28T22:23:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcopolo8](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@marcopolo8](https://forum.kirupa.com/u/marcopolo8)\
**Post date:** [April 28, 2008, 10:23pm UTC](https://forum.kirupa.com/t/fmx2004-determining-size-of-image-loaded-into-blank-movieclip-based-on-tutorial/258852/1 "2008-04-28T22:23:12Z")

</div>

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]](http://www.kirupa.com/developer/mx2004/xml_flash_photogallery.htm)

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
