# Positioning MC's (picture gallery)

**URL:** https://forum.kirupa.com/t/positioning-mcs-picture-gallery/245037
**Category:** flash
**Created:** [November 25, 2007, 6:26pm UTC](https://forum.kirupa.com/t/positioning-mcs-picture-gallery/245037 "2007-11-25T18:26:59Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Kyle87](https://avatars.discourse-cdn.com/v4/letter/k/a5b964/32.png) [@Kyle87](https://forum.kirupa.com/u/Kyle87)
#### Post date: [November 25, 2007, 6:26pm UTC](https://forum.kirupa.com/t/positioning-mcs-picture-gallery/245037/1 "2007-11-25T18:26:59Z")

</div>

Hi I’m new here and but have known about [kirupa.com](http://kirupa.com) for several years now. I appreciate that the tutorials are always well written and easy to follow.

I’ve been following the tutorial to make my own flash gallery + scroll for my website, the tutorial can be found here ([http://www.kirupa.com/developer/mx2004/xml\_flash\_photogallery.htm)](http://www.kirupa.com/developer/mx2004/xml_flash_photogallery.htm%29).

After completing the tutorial I noticed that the picture generated in the image wouldn’t always be centered, because I have vertical and horizontal images in my gallery. I understand that the picture is drawn in the image instance under instance name picture starting from the top left corner. I took a look at the code and it seems to be doing most of the picture generation in the two functions prevImage and nextImage. I tried to write my own function to call within these codes to center the image and here it is.

function reposition(){  
//check if the image width is less than 700  
if (image[p].width \< 700){  
//set the coordinate further right since it will be a vertical picture  
image[p].x = 298;  
}else{  
//set coordinate further left since it will be a horizontal picture.  
image[p].x = 100;  
}  
}

I then proceeded to call this reposition in both prevImage and nextImage however the images have not moved. I have been trying to get this to work for sometime now and would appreciate it if someone could lend a hand 🙂 Here is a link to my gallery i’m making, as u can see it the vertical images are not centered. ([http://skulehouse.cybersmart.ca/gallery/newcollege/ncgallery.html](http://skulehouse.cybersmart.ca/gallery/newcollege/ncgallery.html))
