# Center align xml loaded images

**URL:** https://forum.kirupa.com/t/center-align-xml-loaded-images/168811
**Category:** Uncategorized
**Created:** [November 10, 2005, 6:59am UTC](https://forum.kirupa.com/t/center-align-xml-loaded-images/168811 "2005-11-10T06:59:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![rynobot](https://avatars.discourse-cdn.com/v4/letter/r/bbce88/32.png) [@rynobot](https://forum.kirupa.com/u/rynobot)
#### Post date: [November 10, 2005, 6:59am UTC](https://forum.kirupa.com/t/center-align-xml-loaded-images/168811/1 "2005-11-10T06:59:45Z")

</div>

Hey -  
I have created an XML photo gallery like this: [http://www.kirupa.com/developer/mx2004/xml\_flash\_photogallery.htm](http://www.kirupa.com/developer/mx2004/xml_flash_photogallery.htm)

my problem is that i have different sized photos and always want them centered. The above example loads all photos using the top left as the registration point. I need my images to load into my MovieClip with the registration at the center.

I have tried a few variations on the following:

```auto
picture._align = "CM";
		picture._y = Stage.height/(_root._height/2);
		picture._x = Stage.width/(_root._width/2);

```

In this body of code:

```auto
function loadImage() {
	if (loaded == filesize) {
		picture._align = "CM";
		picture._y = Stage.height/(_root._height/2);
		picture._x = Stage.width/(_root._width/2);
		picture._alpha = 0;
		picture.loadMovie(image[random(total)], 1);
		// // number in brackets signifies how many images there are to choose from
		desc_txt.text = description[p];
		picture_num();
	}
}

```

Anyone have any ideas? thanks.
