Guys, I’m stuck with this code
I want to make a simple next and back button for an instruction page
so far this is what I have
back2_btn.alpha = 0;
back2_btn.mouseEnabled = false;
back2_btn.addEventListener(MouseEvent.CLICK,controlHandler);
next_btn.addEventListener(MouseEvent.CLICK,controlHandler);
function controlHandler(evt:MouseEvent):void {
switch (evt.target) {
case back2_btn :
prevFrame();
next_btn.mouseEnabled = true;
next_btn.alpha = 1;
if(currentFrame == 1) {
//if it is frame 1, disable previous button
back2_btn.mouseEnabled = false;
//dim the button by making it transparent
}
break;
case next_btn :
gotoAndPlay(currentFrame + 21);
back2_btn.mouseEnabled = true;
back2_btn.alpha = 1;
if(currentFrame == 103) {
next_btn.mouseEnabled = false;
next_btn.alpha = 0;
break;
}
}
}
actually i prefer to do it using labels but i was expected to do it effectively,lesser code,lesser size,etc
can anyone tell me what’s wrong with the code?