Featured FLA
» Author: Nitin Tikhe
» Title: Cart
» Description: This Animation Tut is a fun and useful for kids below 15 years. Watch the Flag, Doors, Stick and Horse movements.
» More by Nitin Tikhe
Featured Site
» Posted in the Flash Kit Links section
» Title: Banana Swimwear
» Description: This is a banana swim wear interactive catalog we designed and animated in Flash
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;
}