I am using this AS to check to see if a user has pressed all 6 buttons in a tutorial…if they have not then when they try to click on the Next button a hidden alert message will appear reminding the user to press all 6 buttons before continuing:
function checkButton(targ){
// “targ” refers to the button being pressed
if (targ.pressed) {
targ.pressed = true;
_root.buttonsPressed += 1;
} else if (!targ.pressed) {
targ.pressed = false;
alert._visible = true;
}
}
header_btn.onRelease = function(){
checkButton(this);
gotoAndStop(“Header_area”);
;
}
next_btn.onRelease = function(){
checkButton(this);
gotoAndStop(“Training Exercise_Intro”);
}
prev_btn.onRelease = function(){
checkButton(this);
gotoAndStop(“Template_Intro”);
;
}
swimlane_btn.onRelease = function(){
checkButton(this);
gotoAndStop(“Swim Lanes”);
;
}
numlab_btn.onRelease = function(){
checkButton(this);
gotoAndStop(“Numbering&Labeling”);
;
}
seq_btn.onRelease = function(){
checkButton(this);
gotoAndStop(“Sequence”);
;
}
shapes_btn.onRelease = function(){
checkButton(this);
gotoAndStop(“Shapes”);
;
}
tabs_btn.onRelease = function(){
gotoAndStop(“Tabs”);
;
}
This does not seem to work…Can anyone tell me why?
Thank you.