All you need to do just for simple back/next navigation is use prevFrame() inside your prevButton.onRelease and nextFrame() with your nextButton.onRelease function.:
Code:
prevButton.onRelease = function():Void
{
prevFrame();
}
nextButton.onRelease = function():Void
{
nextFrame();
}
But to make things a bit more friendly to your user, how about making the back button invisible on the first page and setting the next button to take you back to the first page if you are on the last one?
Code:
prevButton.onRelease = function():Void
{
prevFrame();
}
nextButton.onRelease = function():Void
{
// if the current frame we're on is the last one,
// have the next button take us to the first frame
if (_currentframe == _totalframes)
{
gotoAndStop(1);
}
// otherwise go to the next page
else
{
nextFrame();
}
}
this.onEnterFrame = function():Void
{
if (_currentframe == 1)
{
prevButton._visible = false;
}
else
{
prevButton._visible = true;
}
}