XML loaded gallery problems, code reporting errors when uploaded

Hi,
Very new to Actionscript, may have taken on more than I can handle!

I have a code here to play a series of externally loaded images into a movie clip, and fade in / fade out one after the other. No buttons or anything.

Sounds pretty simple!! but I can’t get my head around it!

This code (that I got from a tutorial) works ok, but the images don’t stay up for a set period of time, they seem to appear/disappear according to when the next image is loaded, which is very clever but, sometimes they disappear a bit too quickly, so ideally I would like them to stay on screen for a minimum (or even set) amount of time.

Also, I’m not sure if I edited the code too much, my boss has just informed me that he is receiving errors when he upload the swf and it seems to be tracing back to these images…

Any suggestions at all would be greatly appreciated!

[INDENT][INDENT]this.pathToPics = “images/”;

this.pArray = [“image1.jpg”, “image2.jpg”, “image3.jpg”, “image4.jpg”, “image5.jpg”, “image6.jpg”, “image7.jpg”];
this.fadeSpeed = 20;
this.pIndex = 0;

loadMovie(this.pathToPics+this.pArray[0], _root.photo);
MovieClip.prototype.changePhoto = function(d) {

this.pIndex = (this.pIndex+d)%this.pArray.length;
if (this.pIndex<0) {
	this.pIndex += this.pArray.length;
}
this.onEnterFrame = fadeOut;

};
MovieClip.prototype.fadeOut = function() {
if (this.photo._alpha>this.fadeSpeed) {
this.photo._alpha -= this.fadeSpeed;
} else {
this.loadPhoto();
}
};
MovieClip.prototype.loadPhoto = function() {

var p = _root.photo;
//------------------------------------------
p._alpha = 0;
p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);
this.onEnterFrame = loadMeter;

};
MovieClip.prototype.loadMeter = function() {
var i, l, t;
l = this.photo.getBytesLoaded();
t = this.photo.getBytesTotal();
if (t>0 && t == l) {
this.onEnterFrame = fadeIn;
} else {
trace(l/t);
}
};
MovieClip.prototype.fadeIn = function() {
if (this.photo._alpha<100-this.fadeSpeed) {
this.photo._alpha += this.fadeSpeed;
} else {
this.photo._alpha = 100;
this.onEnterFrame = null;
}
};

function nextUp() {
changePhoto(1);
}
setInterval(nextUp, 4000);[/INDENT][/INDENT]