Tutorials Home
What's New
Top Rated
Submit
myTutes
Random!
Flash MX slide show
Author: Joachim Schnier
| Website: http://www.cancerinform.net/ |
Actionscript: function nextSlide
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;
}
| » Level Basic |
|
|
Added: : 2002-05-09
Rating: 4.59 Votes: 106
Hits: 5206
|
| » Author |
|
The author is a scientist doing cancer research.
|
| » Download |
|
Download the files used in this tutorial.
|
|
Download (306 kb)
|
|
Get conversion and unzipping tools
for PC and Mac here!
|
| » Forums |
|
More help? Search our boards for quick answers!
|
|
Please rate this tutorial, 10 is the top rating, you can also click the
comments link to read/write a review.
|
|
|