AS1 & 2 Photo Gallery Using XML and Flash

I just completed an excellent tutorial, **Photo Gallery **[COLOR=#003366][FONT=Verdana]Using XML and Flash [/FONT][/COLOR][COLOR=#333333][FONT=Verdana]by kirupa | [/FONT][/COLOR][COLOR=#333333][FONT=Verdana]2 September 2004[/FONT][/COLOR]

[COLOR=#0000ff][COLOR=#588cb8]http://www.kirupa.com/developer/mx2004/xml_slideshow.htm[/COLOR][/COLOR][URL=“http://www.kirupa.com/developer/mx2004/xml_flash_photogallery.htm”][COLOR=#004477]http://www.kirupa.com/developer/mx2004/xml_flash_photogallery.htm[/COLOR]

The problem is I have pictures that are different sizes so I am trying to center the picture’s movieclip on the stage dynamically based on the image height and width, but it won’t work. I am unable to get this value from the movieclip for some reason.

[COLOR=#999999]function[/COLOR][COLOR=#999999] [/COLOR][COLOR=#999999]firstImage[/COLOR]COLOR=#999999[/COLOR][COLOR=#999999] [/COLOR][COLOR=#999999]{[/COLOR][COLOR=#999999] [/COLOR][COLOR=#999999]if[/COLOR][COLOR=#999999] [/COLOR][COLOR=#999999]([/COLOR][COLOR=#999999]loaded[/COLOR][COLOR=#999999] [/COLOR][COLOR=#999999]==[/COLOR][COLOR=#999999] [/COLOR][COLOR=#999999]filesize[/COLOR][COLOR=#999999])[/COLOR][COLOR=#999999] [/COLOR][COLOR=#999999]{[/COLOR][COLOR=#999999] [/COLOR][COLOR=#999999]picture[/COLOR][COLOR=#999999].[/COLOR][COLOR=#999999]_alpha[/COLOR][COLOR=#999999] [/COLOR][COLOR=#999999]=[/COLOR][COLOR=#999999] [/COLOR][COLOR=#999999]0[/COLOR][COLOR=#999999]; [/COLOR][COLOR=#999999]picture[/COLOR][COLOR=#999999].[/COLOR][COLOR=#999999]loadMovie[/COLOR][COLOR=#999999]([/COLOR][COLOR=#999999]image[/COLOR][COLOR=#999999][[/COLOR][COLOR=#999999]0[/COLOR][COLOR=#999999]][/COLOR][COLOR=#999999], [/COLOR][COLOR=#999999]1[/COLOR][COLOR=#999999])[/COLOR][COLOR=#999999];[/COLOR][COLOR=#999999]trace(eval (picture)._height); // returns 0[/COLOR]
[COLOR=#999999]desc_txt[/COLOR][COLOR=#999999].[/COLOR][COLOR=#999999]text[/COLOR][COLOR=#999999] [/COLOR][COLOR=#999999]=[/COLOR][COLOR=#999999] [/COLOR][COLOR=#999999]description[/COLOR][COLOR=#999999][[/COLOR][COLOR=#999999]0[/COLOR][COLOR=#999999]][/COLOR][COLOR=#999999]; [/COLOR][COLOR=#999999]picture_num[/COLOR]COLOR=#999999[/COLOR][COLOR=#999999]; [/COLOR][COLOR=#999999]}[/COLOR] Any thoughts?