Position Dynamic Image

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.


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