…I have a number of buttons only one is the correct button to press, the user has three chances to get it right each mistake displays an error message - on the second error message - “Incorrect, please try again following the diagram below” - I need to display a diagram but I don’t know how to set this up using the existing code below. Can anyone advice me how to achieve this or point me the right direction? Your help as always very much appreciated.
stop();
var right_btn = 4;
var message_1 = “Incorrect, please try again”;
var message_2 = “Incorrect, please try again following the diagram below”;
var message_3 = “Incorrect, please try again or click here to return to the demo”;
var m = 0;
for (var i = 1; i<=5; i++) {
var btn = this[“btn”+i];
btn.id = i;
btn.onPress = function() {
if (m<3) {
m++;
}
if (this.id !== right_btn) {
root.errorPanel.info.text = eval("message"+m);
} else {
nextFrame();
}
};
}