# Q: display an image from center\_(xml load)

**URL:** https://forum.kirupa.com/t/q-display-an-image-from-center--xml-load/238182
**Category:** flash
**Created:** [September 7, 2007, 10:23pm UTC](https://forum.kirupa.com/t/q-display-an-image-from-center--xml-load/238182 "2007-09-07T22:23:44Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![nolomaru](https://avatars.discourse-cdn.com/v4/letter/n/71c47a/32.png) [@nolomaru](https://forum.kirupa.com/u/nolomaru)
#### Post date: [September 7, 2007, 10:23pm UTC](https://forum.kirupa.com/t/q-display-an-image-from-center--xml-load/238182/1 "2007-09-07T22:23:44Z")

</div>

hello kirupeans friends, I have been proving a little with an photoslide example(kirupa page).  
it has helped me very much, but but with himself not to be able to change the location of the photo to show, since in the present code it shows it in the location x=0 and y=0, and its registry is located in the left superior corner.  
brothers, it is possible to be changed so that all the photos are but from the center?  
please help

thanks beforehand and excuses by the annoyance.

```auto

delay = 3000;
function loadXML(loaded) {
	if (loaded) {
		xmlNode = this.firstChild;
		image = [];
		total = xmlNode.childNodes.length;
		for (i=0; i<total; i++) {
			image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
}firstImage();
	} else {
		content = "file not loaded!";
	}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("data_slide.xml");

p = 0;

this.onEnterFrame = function() {
	filesize = picture.getBytesTotal();
	loaded = picture.getBytesLoaded();
	preloader._visible = true;
	if (loaded != filesize) {
		preloader.preload_bar._xscale = 100*loaded/filesize;
	} else {
		preloader._visible = false;
		if (picture._alpha<100) {
			picture._alpha += 10;
		}
	}
};

function nextImage() {
	if (p<(total-1)) {
		p++;
		if (loaded == filesize) {
			picture._alpha = 0;
			picture.loadMovie(image[p],1);
			slideshow();
		}
	}
}
function prevImage() {
	if (p>0) {
		p--;
		picture._alpha = 0;
	}
}
function firstImage() {
	if (loaded == filesize) {
		picture._alpha = 0;
		picture.loadMovie(image[0],1);
		slideshow();
	}
}

function slideshow() {
	myInterval = setInterval(pause_slideshow, delay);
	function pause_slideshow() {
		clearInterval(myInterval);
		if (p == (total-1)) {
			p = 0;
			firstImage();
		} else {
			nextImage();
		}
	}
}

```
