# XML gallery question

**URL:** <https://forum.kirupa.com/t/xml-gallery-question/189786>\
**Category:** Uncategorized\
**Created:** [June 6, 2006, 8:36am UTC](https://forum.kirupa.com/t/xml-gallery-question/189786 "2006-06-06T08:36:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Romu](https://avatars.discourse-cdn.com/v4/letter/r/db5fbb/32.png) [@Romu](https://forum.kirupa.com/u/Romu)\
**Post date:** [June 6, 2006, 8:36am UTC](https://forum.kirupa.com/t/xml-gallery-question/189786/1 "2006-06-06T08:36:24Z")

</div>

Hi all,  
I’m designing my web site for my portfolio using the XML gallery described in the tutorials section.

I’m trying to improve the gallery to :

- center the picture in the dedicated zone
- display a black frame around the picture.

Here is the code :

function loadImage(index:Number)  
{  
picture.\_alpha = 0;  
picture.loadMovie(image[index], 1);  
cadre.\_width = picture.\_width + 20;  
cadre.\_height = picture.\_height + 20;  
picture.\_x = CENTER\_X - (picture.\_width / 2);  
picture.\_y = CENTER\_Y - (picture.\_height / 2);  
cadre.\_x = picture.\_x - 10;  
cadre.\_y = picture.\_y - 10;  
}

picture id the movie clip described in the tutorial  
cadre is an empty black movie clip to make the frame around the picture

I get the following problems :

- for the first image only, the width and height are 0
- the frame is displayed over the picture, even if picture is in a dedicated layer over the one containing the frame

I don’t know how to solve these problems, so any help would be greatly appreciated.
