PDA

View Full Version : slideshow script problem



07xxdanutz
October 31st, 2005, 12:56 AM
hi
i've made a script for slideshow an array of images, with fading images.
I'm trying to figure out what's wrong with my script, why it has small pauses between images.
could anyone help me?
thank you.

here is the script, on the first (and only) frame of the movie:


disp_int = 150;
var index = 0;
var img_mc = new MovieClip();
var background1 = new MovieClip();
var iarray = ["test1", "test2", "test3", "test4", "test5", "test6"];

loadImg(index);
loadBackground(++index);

function loadImg(index) {
clip = iarray[index];
file = clip + ".jpg";
img_mc = this.createEmptyMovieClip(clip, 2);
img_mc.loadMovie(file);
}
function loadBackground(index) {
clip = iarray[index];
file = clip + ".jpg";
background1 = this.createEmptyMovieClip(clip, 1);
background1.loadMovie(file);
}

function fade() {
img_mc._alpha -= 10;
if (img_mc._alpha <= 0) {
img_mc._alpha = 100;
loadImg(index);
index++;
if(index==iarray.length) index=0;
loadBackground(index);
}
}
setInterval(fade, disp_int);

tegid
May 5th, 2006, 10:50 PM
I'm experiencing the same problem (Check out http://www.kirupa.com/forum/showthread.php?t=209954)

Does anyone respond to posts on this forum???