Please Help - Trouble with Kirupa Slideshow

Hello,

I have used the Kirupa slide show before with no problem. Works great.

I am using it for another client, now I can’t get the images to show up. I been over the code and everything is fine. Nothing has changed except the image names.

Here is the code as it appears. Please help, I am in a major crunch. I have been trying to figure this out for days.

/*
i wrote this code, but you can use and abuse it however you like.
the methods are defined in the order which they occur to make it
easier to understand.
*/
// variables ------------------------------------------
// put the path to your pics here, include the slashes (ie. “pics/”)
// leave it blank if they’re in the same directory
this.pathToPics = “images/”;
// fill this array with your pics
this.pArray = [“travel0.jpg”, “travel1.jpg”, “travel2.jpg”, “travel3.jpg”, “travel.jpg”, “travel.jpg”, “travel6.jpg”, “travel7.jpg”, “travel8.jpg”, “travel9.jpg”];
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+this.pArray[0], _root.photo);
MovieClip.prototype.changePhoto = function(d) {
// make sure pIndex falls within pArray.length
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() {
// specify the movieclip to load images into
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;
}
};
// 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);

Hey Scotty,

Not sure I am following you. Please excuse my ignorance. What do you mean exactly?

Hi,

I was wondering if anyone knows how to preload the images for the slideshow? There is too much lag time between each picture.

go here to see what I mean: http://www.vuhuynh.com

Thanks so much!

My bad;)
If you’re using the slideshow as standalone and the pictures don’t show up, be sure that your pictures are in the non-progressive jpg format.
If you’re loading the slideshow in a main movie, have a look at your code, you’ll find two time “_root.photo”, change that in “this.photo”. The same for your buttons. Hope this will help:)

scotty(-:

Scotty, thanks a million. That was the solution. I also resaved with the nonprogressive jpg. Works like a charm. Thank you. You are a real life saver. I owe ya one and many more to come :smiley:

welcome:thumb:

Scotty,

ITS ME AGAIN. :ne:

Everything worked fine on with the first slide show. I did a save as to use for another client. I changed nothing except the size of the images and photomc. It works locally on my machine just fine. But when I upload it to my server, the images do not show up. What is it this time. And do you have a more reliable cool slideshow that I cound use. This one seems to fragile.