Flash Fade Image with setInterval

Having difficulty fading image.  setInterval does not appear to be working.  The fade stops at 75.

// SHOW RANDOM IMAGES
images = new Array();
path = "http://www.bristolhillsoutfitters.com/pics/";
for (i=0; i<4; i++) {
 images[i] = path+"deer"+i+".jpg";

}
function fadeImage() {
 if (_root.imageHolder_mc._alpha>10) {
  _root.imageHolder_mc._alpha -= 25;
  trace(_root.imageHolder_mc._alpha);
 }
}
function imageLoader() {
 imageNo = random(3);
 _root.createEmptyMovieClip("imageHolder_mc", 200);
 _root.imageHolder_mc.loadMovie(images[imageNo]);
 setInterval(fadeImage(), 5000);
}
imageLoader();

Thanks!

Terry
LVL 1
splendorxAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
hsmtpConnect With a Mentor Commented:
Hi splendorx,

Use it like this:
setInterval(fadeImage, 5000); // without brackets

And 5 seconds is too much for smooth fade, try something smaller, like 500.
0
 
splendorxAuthor Commented:
thanks!!  works great!
0
 
hsmtpCommented:
You're welcome! Don't forget to click button "Accept Answer" :)
0
All Courses

From novice to tech pro — start learning today.