View Full Version : help with next/previous code!!!!!!!!!!
suev3v
March 27th, 2010, 02:04 PM
Im trying to make a slide show with a next and previous button. I have name these two buttons next_button and previous_button
I 've tried the code ;
next_button.onRelease = goNext;
previous_button.onRelease = goPrev;
function goNext():Void{
gotoAndPlay(_currentframe+1);
}
function goPrev():Void{
gotoAndPlay(_currentframe-1);
}
however , it isn't working , can anyone help?! plzzzzzzzzzzzzz
and how should i apply the code ?! maybe my method was wrong
Many thanks
mykhel0003
March 27th, 2010, 02:48 PM
Well your code seems to be AS2, it won't work on AS3.. Are you using AS3 or AS2?
suev3v
March 27th, 2010, 03:32 PM
ar..........guess i am confused
i think i am using as3
totally new with these stuff..so might be confused with as2 and as3 , sorry
Ziggwies
March 27th, 2010, 05:33 PM
Try this AS3 code...
next_button.addEventListener(MouseEvent.CLICK, goNext);
previous_button.addEventListener(MouseEvent.CLICK, goPrev);
function goNext(evt:MouseEvent):void {
gotoAndPlay(currentFrame + 1);
}
function goPrev(evt:MouseEvent):void {
gotoAndPlay(currentFrame - 1);
}
suev3v
March 27th, 2010, 07:33 PM
thanks ,
the code shows no errors now ,
however, the buttons doesn't work while i test the movie
it won't go to the next page or the pervious page while i click on it
actually , how should i apply the codes? maybe my method was wrong , i am not sure
i add a new layer called ''button'' and select frame1 and apply the code in action script.
is this right or it is wrong?
many many thanks
Ziggwies
March 28th, 2010, 04:34 PM
Paste the code in a frame where the buttons exist.
Also make sure you have buttons with the instance names "next_button" and "previous_button".
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.