# AS1 & 2 Photo Gallery Using XML and Flash

**URL:** <https://forum.kirupa.com/t/as1-2-photo-gallery-using-xml-and-flash/308655>\
**Category:** flash\
**Created:** [April 27, 2010, 8:58pm UTC](https://forum.kirupa.com/t/as1-2-photo-gallery-using-xml-and-flash/308655 "2010-04-27T20:58:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![codeBoyX](https://avatars.discourse-cdn.com/v4/letter/c/85e7bf/32.png) [@codeBoyX](https://forum.kirupa.com/u/codeBoyX)\
**Post date:** [April 27, 2010, 8:58pm UTC](https://forum.kirupa.com/t/as1-2-photo-gallery-using-xml-and-flash/308655/1 "2010-04-27T20:58:04Z")

</div>

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

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?
