Next we need to add some actionscript to give functionality to buttons. We have to create several functions, which we place into the first frame under ´Actions´. We will first discuss how to have slides shown in a row forward and backward. For this we create the two functions ´nextSlide´ and ´previousSlide´. k is a global variable here and set to "0" so that the start is always from the first slide. The first slide can be any number and does not have to be 1. We also add actionscript to get the current date.
Note: Comments to the actionscript are written in the fla file.
stop();
myDate = new Date();
dateTextField = (myDate.getMonth() + " - " +myDate.getDate() + " - " +myDate.getFullYear());
k = 0;
function nextSlide(firstSlide,lastSlide,slideName,slideText) {
k = k+1;
i = (firstSlide - 1) + k;
newSlide = slideHolder.loadMovie(slideName + i + ".jpg");
newText = loadVariablesNum(slideText + i + ".txt", 0);
if (i == firstSlide) {
_root.leftBut._visible = false;
}else{
_root.leftBut._visible = true;
}
if (i == lastSlide) {
_root.rightBut._visible = false;
k = 1;
}else{
_root.rightBut._visible = true;
}
_root.whiteBox._visible = true;
_root.newSlide;
_root.newText;
}