# Position Dynamic Image

**URL:** https://forum.kirupa.com/t/position-dynamic-image/48306
**Category:** flash
**Created:** [April 12, 2004, 12:04pm UTC](https://forum.kirupa.com/t/position-dynamic-image/48306 "2004-04-12T12:04:19Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![alwaysdrifting](https://avatars.discourse-cdn.com/v4/letter/a/a8b319/32.png) [@alwaysdrifting](https://forum.kirupa.com/u/alwaysdrifting)
#### Post date: [April 12, 2004, 12:04pm UTC](https://forum.kirupa.com/t/position-dynamic-image/48306/1 "2004-04-12T12:04:19Z")

</div>

I have a MC called image\_mc. When I load an image from XML, I want the centre of the image to be over the MC.

Here is my code which isn’t working. Currently, it positions the top left of the image at the MC regardless if the image is portrait or landscape.

```auto

pic = portfolioTag.childNodes[num].attributes.IMAGE;
// LOAD IN FIRST PICTURE IN XML FILE, first occurance of IMAGE NODE

image_mc.loadMovie(pic);
image_mc._x = image_mc._x-pic._width/2;
image_mc._y = image_mc._y-pic._height/2;

```

Thanks guys
