I have to create a slideshow that loads 16 different swf’s into a container_mc.
Each swf has an image with accompanying voiceover.
I have the basic next, previous, first, and last slide buttons working but they want to add a slider bar that plays and u can slide to a specific section of the slide show…
The slidebar is where I am having troubles.
It is partially working now, just needs to be tweeked… It is reading the variables, and setting the slide label text to the correct label, BUT it is only doing this once when the mouse is pressed and does NOT update when the mouse is dragged. Any ideas? I tried so many different ways and can’t figure this out.
Here is what I have so far…
This is the code on the first frame for the buttons
nowPlaying = 1;
lastPlayed = 0;
playingNext = 2;
autoPlaySlides = false;
//
nowPlaying_txt.text = nowPlaying;
lastPlayed_txt.text = lastPlayed;
playingNext_txt.text = playingNext;
//
loadMovie("slide"+nowPlaying+".swf", "content_mc");
//
nextBTN.btn.onPress = function() {
if (nowPlaying == 4) {
//Dont' change slide
} else if (nowPlaying<4) {
nowPlaying++;
lastPlayed++;
playingNext++;
loadMovie("slide"+nowPlaying+".swf", "content_mc");
nowPlaying_txt.text = nowPlaying;
lastPlayed_txt.text = lastPlayed;
playingNext_txt.text = playingNext;
}
};
prevBTN.btn.onPress = function() {
if (nowPlaying>1) {
nowPlaying--;
lastPlayed--;
playingNext--;
loadMovie("slide"+nowPlaying+".swf", "content_mc");
nowPlaying_txt.text = nowPlaying;
lastPlayed_txt.text = lastPlayed;
playingNext_txt.text = playingNext;
} else if (nowPlaying == 1) {
//Don't change slide
}
};
firstSlideBTN.btn.onPress = function() {
loadMovie("slide"+1+".swf", "content_mc");
nowPlaying = 1;
lastPlayed = 0;
playingNext = 2;
nowPlaying_txt.text = nowPlaying;
lastPlayed_txt.text = lastPlayed;
playingNext_txt.text = playingNext;
};
endSlideBTN.btn.onPress = function() {
loadMovie("slide"+4+".swf", "content_mc");
nowPlaying = 4;
lastPlayed = 3;
playingNext = 5;
nowPlaying_txt.text = nowPlaying;
lastPlayed_txt.text = lastPlayed;
playingNext_txt.text = playingNext;
};
//
stop();
There is a movieclip named “slider” with this code inside the first frame inside of the slider MC
//
sliderInfo._visible = false;
//
checkPositionStatus = false;
checkPosition = function () {
if (sliderPosition<=6) {
slideLabel = "Go to slide 1";
}
if (sliderPosition>=7 && sliderPosition<=12) {
slideLabel = "Go to slide 2";
}
if (sliderPosition>=13 && sliderPosition<=18) {
slideLabel = "Go to slide 3";
}
if (sliderPosition>=19 && sliderPosition<=24) {
slideLabel = "Go to slide 4";
}
if (sliderPosition>=25 && sliderPosition<=30) {
slideLabel = "Go to slide 5";
}
if (sliderPosition>=31 && sliderPosition<=36) {
slideLabel = "Go to slide 6";
}
if (sliderPosition>=37 && sliderPosition<=42) {
slideLabel = "Go to slide 7";
}
if (sliderPosition>=43 && sliderPosition<=48) {
slideLabel = "Go to slide 8";
}
if (sliderPosition>=49 && sliderPosition<=54) {
slideLabel = "Go to slide 9";
}
if (sliderPosition>=55 && sliderPosition<=60) {
slideLabel = "Go to slide 10";
}
if (sliderPosition>=61 && sliderPosition<=66) {
slideLabel = "Go to slide 11";
}
if (sliderPosition>=67 && sliderPosition<=72) {
slideLabel = "Go to slide 12";
}
if (sliderPosition>=73 && sliderPosition<=78) {
slideLabel = "Go to slide 13";
}
if (sliderPosition>=79 && sliderPosition<=84) {
slideLabel = "Go to slide 14";
}
if (sliderPosition>=85 && sliderPosition<=90) {
slideLabel = "Go to slide 15";
}
if (sliderPosition>=91) {
slideLabel = "Go to slide 16";
}
};
//
sliderPosition = 0;
dragger.onPress = function() {
trace(slideLabel);
checkPosition = true;
this.sliderInfo._visible = true;
//this.sliderInfo.dragTxt.text = "Go to slide "+_parent.slideLabel;
this.startDrag(true,0,0,line._width,0);
sliderPosition = Math.round(this._x*100/line._width);
do {
checkPosition;
} while (checkPosition == true);
};
dragger.onRelease = dragger.onReleaseOutside=stopDrag;
//this.sliderInfo.visible = false;
//checkPosition = true;
//
For the slider I need to create some kind of loop that checks where the dragger is.
If it is between 1 and 6 slideLabel = “Go to slide 1”;
If it is between 7 and 12 slideLabel = “Go to slide 2”;
and so on up to 16…
when the dragger is released on the slide the user wants to go to it needs to load specified .swf.
I know its probably a simple answer but I can’t figure this out right now and its really annoying me haha! Any help would be greatly appreciated.