Hello all!
Someone on here wrote this script, it is part of a gallery/slideshow. I combined 2 different slideshows together to get a preloading all images + next, pause, play.
What I need help with is to create a prev button, I have copied the below AS from the nextImage button, and changed all the things I can think of, but it always does something wrong… like the “pos_txt” will go backwards, but the image and description go forward on first prev click, then start going backwards… and other weird things like that.
If needed I will post the FLA, but I think anyone who can actually write AS will have no problem with this. (I am not that person obviously! hehe
So below is the “nextImage” code and below that is what I changed for the “prevImage” button.
function nextImage() {
pos_txt.text = a+1+" / "+total;
for (var obj in movies) {
if (movies[obj].p != a ) {
if (movies[obj]._alpha>0) {
movies[obj].onEnterFrame = fadeout;
}
} else {
movies[obj]._alpha =0
movies[obj]._x = 10
movies[obj]._y =10
movies[obj].onEnterFrame = fadein;
}
}
desc_txt.text = description[a];
a++;
a %= image.length;
}
So the code below is the closest I could get the prev button to work. What it does is reverse the counter(pos_txt) right, but makes (description) and the images go up one, then reverse… wierd, wierd.
Also, in the code is “a %= image.length;” which makes it cycle from the last image to the first image once you get to the end, but when using the “prevImage” button with the code below it goes to 1 then -1, -2, -3, -4 and so on, instead of cycling to the last image.
function prevImage() {
pos_txt.text = a-1+" / "+total;
for (var obj in movies) {
if (movies[obj].p != a ) {
if (movies[obj]._alpha>0) {
movies[obj].onEnterFrame = fadeout;
}
} else {
movies[obj]._alpha =0
movies[obj]._x = 10
movies[obj]._y =10
movies[obj].onEnterFrame = fadein;
}
}
desc_txt.text = description[a];
a--;
a %= image.length;
}
Thanks,
Dale!
[FONT=Courier New][LEFT][COLOR=#000000]
[/COLOR] [/LEFT]
[/FONT]