PDA

View Full Version : how to customize slideshow?


ricoboxing
07-24-2006, 03:24 PM
Hi, I really suck at actionscript so I need your help!

I'm using the template to design a slideshow. At the last frame/slide of the show, I want the next button to still appear and go back to the first frame/slide when clicked. I can't figure out how to do this. Thanks for your help.

heres the code of the controller

function updateFrame (inc) {
// send slides to new frame
newFrame = _root._currentFrame + inc;
_root.gotoAndStop(newFrame);

updateStatus();

if (_root._currentFrame == 1) {
prevBtn.gotoAndStop(2);
} else {
prevBtn.gotoAndStop(1);
}
if (_root._currentFrame == _root._totalFrames) {
nextBtn.gotoAndStop(2);
} else {
nextBtn.gotoAndStop(1);
}
}

function updateStatus () {
_root.statusField = _root._currentFrame - 10 + " of " + (_root._totalFrames - 10);
}

function autoplayInit () {
startTime = getTimer();
hideControls();
updateStatus();
}

function autoplay () {
if (autoplayStatus != 0) {
// get the current time and elapsed time
curTime = getTimer();
elapsedTime = curTime-startTime;

// update timer indicator
indicatorFrame = int(4/(delay/(elapsedTime/1000)));
indicator.gotoAndStop(indicatorFrame+1);

// if delay time if met, goto next photo
if (elapsedTime >= (delay*1000)) {
if (_root._currentframe == _root._totalframes) {
_root.gotoAndStop(1);
} else {
_root.nextFrame();
}
autoplayInit();
}
}
}

function hideControls () {
nextBtn.gotoAndStop(2);
prevBtn.gotoAndStop(2);
}

updateFrame();
autoplayStatus = 0;