Hi, I am not for sure if I am posting in the correct room. I have a flash photo gallery question. I am making a flash webpage using CS4 using a previous and next button. Both the previous and next button work but one problem. It does not stop at the first gallery instead it goes all the way to the end to the very last gallery. Example. One gallery is name food, the next family, and after sports, and etc. The next and previous button goes to the next gallery without stopping.

My question is, is there a way that I can make it stop so that it stop at the very end of each gallery instead of jumpin over to the next?

This is my code that I use.

stop ();

Previousbtn.addEventListener (MouseEvent.CLICK, backward);
Nextbtn.addEventListener (MouseEvent.CLICK, forward);

function forward (event : MouseEvent) {

if (this.currentFrame == this.totalFrames) {
gotoAndStop (1);
}
else {
nextFrame();
}
}

function backward(event : MouseEvent) {

if (this.currentFrame == 1) {
gotoAndStop (this.totalFrames);
}
else {
prevFrame();
}
}
Member Avatar for LastMitch

It does not stop at the first gallery instead it goes all the way to the end to the very last gallery.

There's nothing wrong with your code.

Did you insert the stop(); in key frame 1?

Hi LastMitch yes I did. I stayed up until 3 am and solve it. I have been working on my photo porfolio page for over 6 months and save this for last. Well not really last I have a few bugs left to fix. The problem was that I needed to tell the actionscript which frames forward and which frames backward to sow. Since I have the total frame of 45 it was showing the total frame. Therefore, where it say in total.Frame something in me told me to try a number and I did the same for the gotoStop and it work. After it workd I did the same to the rest but had to change the random of the numbers because then one gallery was going backward into the gallery before or continue to go forward into the next gallery.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.