Actionscript: frame 1, Loading thumbnails and function to load slides
The next two functions are to load the thumbnails and to make the thumbnail buttons functional (function showSlide).
//function to load the thumbnails
function preView (firstSlide,lastSlide,nailName) {
clearEverything();
//loading the thumbnails
while (firstSlide <= lastSlide) {
_root["nailHolder_" + firstSlide].loadMovie(nailName + firstSlide +".jpg");
firstSlide++;
}
unloadMovie(slideHolder);
// load text for preview
loadVarsText = new loadVars();
loadVarsText.load("preview.txt");
loadVarsText.onLoad = function(success) {
if(success) {
headline.html = true;
headline.htmlText = this.headText;
}else{
trace("text not loaded");
}
}
}
//function for each thumbnail button to load slide into slideholder.
//This function is attached to thumbnail buttons. Each slidenumber has
//to be set individually. See the invbox actions for details.
function showSlide (slideNumber,slideName,slideText,lastSlide) {
clearEverything();
_root.slideHolder.unloadMovie();
_root.slideHolder.loadMovie(slideName + slideNumber + ".jpg");
newText = (slideText + slideNumber + ".txt");
loadVarsText = new loadVars();
loadVarsText.load(newText);
loadVarsText.onLoad = function(success) {
if(success) {
scroller.html = true;
scroller.htmlText = this.myText;
}else{
trace("not loaded");
}
}
//This is to hide the slideshow right and left buttons.
_root.rightBut._visible = false;
_root.leftBut._visible = false;
}