How to add a wait or interval in seconds for fade in/out effects
Hi,
I have the following actionscript which is working fine, but I would like to wait for some seconds each image once has reached the alpha in 100, if you see the example in the header (www.vmortiz.com/index2.htm) what it does is that the image fades in and when it gets to 100 starts fading out, and I want that when it gets the alpha in 100, keep it for let's say 5 seconds and then fade it out. Could ou please help to do so?
square._alpha = 0;
whichPic = 0;
_root.onEnterFrame = function() {
if (whichPic<4 && !fadeIn && !fadeOut) {
fadeOut = true;
whichPic++;
}
else if (whichPic>=4) {
whichPic = 1;
}
if (square._alpha>10 && fadeOut) {
square._alpha -= 2;
}
if (square._alpha<10) {
loadMovie("../images/banner/foto"+whichPic+".jpg", "square");
fadeOut = false;
fadeIn = true;
}
if (square._alpha<100 && fadeIn && !fadeOut) {
square._alpha += 5;
} else {
fadeIn = false;
}
};
Thanks
Regards
