[newbie] Help with a fade-in/fade-out photo gallery

Hello everybody,

I’m trying to improve Kirupa’s photo gallery by using an XML file.
(http://www.kirupa.com/developer/mx/photogallery.htm)

It is more or less working except at the beginning of the flash animation. I got a error message. Then when I use the arrow buttons, it’s working fine.

This is the piece of code :

#############

var myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = parseXML;

myXML.load(“slideshow.xml”);

function parseXML(success) {

if (success == true) {
rootNode = myXML;
_root.slide_names = new Array();
_root.slide_titles = new Array();

if (rootNode.firstChild.nodeName.toLowerCase() == “slideshow”) {
var nm = rootNode.firstChild.childNodes;
for (i=0; i<=nm.length; i++) {
if (nm*.nodeName == “slide”) {
_root.slide_names.push(nm*.attributes.img_name);
_root.slide_titles.push(nm*.firstChild.nodeValue);

}
}
}
_root.nextFrame();
play()
}
}

this.pathToPics = “animation/”;
this.fadeSpeed = 20;
this.pIndex = 0;

// MovieClip methods ----------------------------------
// d=direction; should 1 or -1 but can be any number
//loads an image automatically when you run animation

loadMovie(this.pathToPics+_root.slide_names[this.pIndex], _root.photo);

MovieClip.prototype.changePhoto = function(d) {
// make sure pIndex falls within pArray.length
this.pIndex = (this.pIndex+d)%_root.slide_names.length;
if (this.pIndex<0) {
this.pIndex += _root.slide_names.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() {
// specify the movieclip to load images into
var p = _root.photo;
//------------------------------------------
p._alpha = 0;
p.loadMovie(this.pathToPics+_root.slide_names[this.pIndex]);
currentIndex = this.pIndex;
imageText = _root.slide_titles[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;
}
};
// Actions -----------------------------------------
// these aren’t necessary, just an example implementation
this.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
this.changePhoto(-1);
} else if (Key.getCode() == Key.RIGHT) {
this.changePhoto(1);
}
};
Key.addListener(this);

#############

This is the error message I got :

Error opening URL “file:///H|/Photographie/flash%5Fkit/kirupacom/animation/”

It looks like it can read the array in the following command:
loadMovie(this.pathToPics+_root.slide_names[this.pIndex], _root.photo);

I would appreciate any help.

Many thanks.
Gohan

I’m getting a similar message stating…

Error opening URL “C:\ocuments%and%Settings\arlo%Esannason\y%Documents\esign\lobol%Spin\icts
yce1.gif”

HELP!!!