Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Flash Fade Image with setInterval

Posted on 2004-10-22
3
Medium Priority
?
361 Views
Last Modified: 2008-02-26
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
0
Comment
Question by:splendorx
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
hsmtp earned 600 total points
ID: 12381688
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
 
LVL 1

Author Comment

by:splendorx
ID: 12382158
thanks!!  works great!
0
 
LVL 6

Expert Comment

by:hsmtp
ID: 12382471
You're welcome! Don't forget to click button "Accept Answer" :)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question