# Slideshow script problem

**URL:** https://forum.kirupa.com/t/slideshow-script-problem/167701
**Category:** Uncategorized
**Created:** [October 31, 2005, 5:56am UTC](https://forum.kirupa.com/t/slideshow-script-problem/167701 "2005-10-31T05:56:50Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![07xxdanutz](https://avatars.discourse-cdn.com/v4/letter/0/c0e974/32.png) [@07xxdanutz](https://forum.kirupa.com/u/07xxdanutz)
#### Post date: [October 31, 2005, 5:56am UTC](https://forum.kirupa.com/t/slideshow-script-problem/167701/1 "2005-10-31T05:56:50Z")

</div>

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);
