# Align XML external image in movie clip

**URL:** https://forum.kirupa.com/t/align-xml-external-image-in-movie-clip/262582
**Category:** flash
**Created:** [June 7, 2008, 7:43am UTC](https://forum.kirupa.com/t/align-xml-external-image-in-movie-clip/262582 "2008-06-07T07:43:03Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Devendra\_Singh](https://avatars.discourse-cdn.com/v4/letter/d/cc9497/32.png) [@Devendra\_Singh](https://forum.kirupa.com/u/Devendra_Singh)
#### Post date: [June 7, 2008, 7:43am UTC](https://forum.kirupa.com/t/align-xml-external-image-in-movie-clip/262582/1 "2008-06-07T07:43:03Z")

</div>

have a simple Flash/XML photo gallery in which image location and information is being pulled from the XML file. The actual external images are being displayed via a movie clip, “picture”.

My trouble is that my external images are all different sizes, and I would like to align them to the horizontal center of my Flash area. While I can align the movie clip to horizontal center, it is actually aligning the top left corner of the picture (0, 0) to horizontal center.

Is there some sort of setting I can do with the movie clip itself? Or do I need to do something in my action script, which is as follows. Any assistance is very much appreciated… thanks

---

<div class="post-metadata">

### Author: ![matthewjumps](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@matthewjumps](https://forum.kirupa.com/u/matthewjumps)
#### Post date: [June 8, 2008, 9:19am UTC](https://forum.kirupa.com/t/align-xml-external-image-in-movie-clip/262582/2 "2008-06-08T09:19:19Z")

</div>

```auto

picture._x = (Stage.width/2)-(picture._width/2); //centres horizontally
picture._y = (Stage.height/2)-(picture._height/2); //centres vertically

```

this will centre the picture movie clip in the middle of the stage.

if you need to centre it on something else (like the centre of another movie clip) let me know its pretty similar
