Flash Action Script 3 help...

happi_fairy

New Member
Hello!

I have been set an assignment to make a photo viewer with forward and backwards buttons but my code isn't working :/

that is the code ive got but the line it seems to have problems with is the one marked with **

stop ()

btn1.addEventListener (MouseEvent.CLICK, backward);
btn2.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(1): this.totalFrames
}
else{
prevFrame();
}
}

any help would be greatly appreciated as I need this completed by monday!

Thank you

:)
xxxx
 
yes unfortunately it has to be in flash :/

I did it a couple of years ago but I really can't find the error at all now! :(
 
This will work:

stop ()

btn1.addEventListener (MouseEvent.CLICK, backward);
btn2.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();
}
}
 
Back
Top