Please help, my preloader and the xml (similar to the image slideshow) issues with PL

Can anyone help me out please, I require a preloader each time i click the next button, I basically need it to check to see if the image, or rather information has been loaded if so set the visibility of the prelaoder to false.

I have a preloader ready, very basic for the time being, but a little confused as to getting it working.

Any help would be good, many thanks

trev

my code for xml.



//xml and array containers
var x:XML = new XML();
x.ignoreWhite = true;

var images:Array = new Array(); //store all images into an array
var companys:Array = new Array(); //store all companys into an array
var involvements:Array = new Array(); //store all involvements into an array
var descriptions:Array = new Array(); //store all descriptions into an array
var urls:Array = new Array();

//keep track of which image is on
var whichClient:Number;

x.onLoad = function(loaded) {
	
	if (loaded) {
	//get us to the root element, which is childNode
	var client:Array = this.firstChild.childNodes;	
	for (i=0;i<client.length;i++) {		
		//push - array command (tag it onto the end of the array)
		images.push(client*.attributes.image);
		companys.push(client*.attributes.company);
		involvements.push(client*.attributes.involvement);
		descriptions.push(client*.attributes.description);
		urls.push(client*.attributes.url);
	}		
	
	//loads a clip at the start
	holder.loadMovie(images[0]);
	company.text = companys[0];
	involvement.text = involvements[0];
	description.text = descriptions[0];
	url.text = urls[0];
	whichClient = 0;

	} else {
	
	error.text = "xml not found or does not exist";
  
  }
}

x.load("clients.xml");

//previous button funtion
previous.onRelease = function() {
		if (whichClient > 0) {
			whichClient--; //subtract by 1
			holder.loadMovie(images[whichClient]);
			company.text = companys[whichClient];
			involvement.text = involvements[whichClient];
			description.text = descriptions[whichClient];
			url.text = urls[whichClient];
		}
}
		
//next button funtion
next.onRelease = function() {
	if (whichClient < images.length-1) {
			whichClient++; //add by 1
			holder.loadMovie(images[whichClient]);
			company.text = companys[whichClient];
			involvement.text = involvements[whichClient];
			description.text = descriptions[whichClient];
			url.text = urls[whichClient];
		}
}