Hello, This is my action script (open source, if you want to modify it and fell free to use it!!) not a real expert, but I have a problem with this code.
the aim of this script is to make a slide show, loading images form an external file (called: images) they fade in, then fade out, then load the next swf in the Next Level.
–My Question is that I cannot manage to set different times when the image load to stay in the screen (1, 2, 3 sec (1000, 2000, 3000 miliseconds) and then to fade.
They Need to fade in, stay 1,2 or three seconds, and then fade out… but its not working, I used the SetIntervalID… but nothing…
after loading the 1.swf this will call a 2.swf with a different time of the image to remain, lets say 5 sec, and then this swf will call the 3.swf and remain 8 sec??
any ideas?? Will much appreciate
i’ve tried to chace the number to 2000, 6000 but nothing in this line: intervalID = setInterval(changePicture, 1);
here is the code:
photo.empty._alpha = 0;
whichPic = 2;
var level:Number = 2;
var wasDoneOnce:Boolean = false;
var intervalID:Number=5;
// fadeMode defines if you want tou use fade out(slow) or quick jump to another picture (fast)
var fadeMode:String = “fast”;
loadMovie(“images/1.jpg”, photo.empty);
_root.onEnterFrame = function() {
if (photo.empty._alpha>2 && fadeOut) {
if(fadeMode==“slow”){
photo.empty._alpha -=100;
wasDoneOnce = true;
trace(photo.empty._alpha);
} else if(fadeMode==“fast”){
//set the time of the image appearance in fast mode in miliseconds 2000 miliseconds = 2 seconds
intervalID = setInterval(changePicture, 1);
}
}
if (photo.empty._alpha<2) {
trace(“was done once”);
if(wasDoneOnce){
//set the time of the image appearance in slow mode miliseconds 2000 miliseconds = 2 seconds
intervalID = setInterval(changePicture, 1);
} else {
fadeOut = false;
fadeIn = true;
whichPic++;
}
}
if (photo.empty._alpha<100 && fadeIn && !fadeOut) {
photo.empty._alpha +=100;
} else {
if (whichPic>=6) {
stop();
} else {
fadeOut = true;
}
}
};
function changePicture():Void {
trace(“changePicture”);
delete _root.onEnterFrame;
loadMovieNum(“2.swf”, level);
clearInterval(intervalID);
}