Internet Commerce

Partners & Affiliates














Developer Channel

internet.com


Tutorials Home What's New Top Rated Submit myTutes Random!

Search Tutorials


Tutorials Tutorials » Dynamic_Content

Categories Flash MX slide show
Author: Joachim Schnier | Website: http://www.cancerinform.net/ |

 
Page 6
«prev 1 2 3 4 5 6 7 8 9 10 11 next»

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; }

«prev 1 2 3 4 5 6 7 8 9 10 11 next»

» 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.
10 9 8 7 6 5 4 3 2 1
Read or Post Comments
 
   
 


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers