# How to load images in the center than top left?

**URL:** https://forum.kirupa.com/t/how-to-load-images-in-the-center-than-top-left/255395
**Category:** Uncategorized
**Created:** [March 21, 2008, 10:20pm UTC](https://forum.kirupa.com/t/how-to-load-images-in-the-center-than-top-left/255395 "2008-03-21T22:20:01Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![lambie](https://avatars.discourse-cdn.com/v4/letter/l/ba8739/32.png) [@lambie](https://forum.kirupa.com/u/lambie)
#### Post date: [March 21, 2008, 10:20pm UTC](https://forum.kirupa.com/t/how-to-load-images-in-the-center-than-top-left/255395/1 "2008-03-21T22:20:01Z")

</div>

Hello, I am a beginner in Flash, and I am creating a gallery with XML. I am trying to make the gallery load image in the center rather than the top left, and I am very stuck.

I have a movie clip layer named picture\_area, and inside it has two layers. The top one is picture\_mask, a mask of the size 700 x 400 (width x height), and the second layer is picture\_load, just an empty movie clip to load pictures.

At first, everything works well because all my images is 700 x 400, however, I start to run into images that cannot be cropped at that size, they are maybe 500 x 400, or 700 x 200. Those images are loaded from the very top left, leaving a huge white space on the rest of the 700 x 400 area. I want to even it out by placing the images in the center.

Is there any way that I can make Flash to know the size of the image, and it will just place it in the center?

Thank you for your time. Looking forward to your replies.
