Slideshow help... please

Hi everyone.
I’m trying to make a slideshow with transitions between the photos and a set of controls at the bottom.

I was wondering if it’s possible to have:

  1. A button which will advance 40 frames and stop (the “next photo” button)
  2. A button which will go back 40 frames and stop (the “previous photo” button)
  3. A button which will go to the nearest frame that is a multiple of 40 and stop (the “stop” button)

Any suggestions would be very helpful.

Thanks a lot,

matt

on(release){

gotoandplay(this._currentframe+40);
}

warning, you’ll have to adjust in case it exceeds total number of frames.

now you can change the + to a - or a / for multiplier…

Thanks a lot, the +/- 40 is very helpful, but I’m not sure if the multiplier is quite what I was looking for.

Our slide show is timed, but we wanted to have a row a buttons across the bottom. When the “stop” button is pressed, we wanted the show to stop only on frames that are multiples of 40.

For example, if the stop button were to be pressed on frame 52, the movie would go to frame 40, and if it were pressed on frame 62 it would go to 80 (which would be the nearest multiple of 40).

In other words, if pressed between frames 20 and 60 the movie would stop on frame 40; If pressed between frames 60 and 100 the movie would go to and stop on frame 80; and so on.

Is this possible?

Thanks,

matt

hey, i just had my coffee so i’m feeling chipper. here’s two methods to the nearest multiple of 40:


// modulo method
if((diff = _currentframe%40)>20) diff -= 40;
gotoAndStop(_currentframe-diff);


// Math.round method
gotoAndStop(Math.round(_currentframe/40)*40);

Awesome!

Thanks guys!

matt