I have a submit button with an input text field in which the user enters an answer. If they answer correctly I have a telltarget telling a movieclip called "score" to advance one frame. The idea is once the playhead advances the correct number of times it displays a "Congrats" message. However, the way it works now it advances the playhead if they push the Submit button more then once after they correctly answer the question. Is there a way to script this so it only advances the playhead once after they press submit once with the correct answer and not advance it again after clicking it once? (the correct answer is "one")
on (press) {
if (answer.text == "one") {
message.text = "Correct! Select next question.";
tellTarget ("../score") {
nextFrame();
}_root.grid_mc.ph_mc.nextFrame();
_root.grid_mc.ph_mc.ph_btn.enabled = false;
} else if (answer.text == "one") {
message.text = "Correct! Select next question.";
_root.grid_mc.ph_mc.nextFrame();
_root.grid_mc.ph_mc.ph_btn.enabled = false;
} else if (answer.text == "ONE") {
message.text = "Correct! Select next question.";
_root.grid_mc.ph_mc.nextFrame();
_root.grid_mc.ph_mc.ph_btn.enabled = false;
} else {
message.text = "Incorrect. Try again or skip.";
}
}
on (press) {
if (answer.text == "one") {
message.text = "Correct! Select next question.";
tellTarget ("../score") {
nextFrame();
}_root.grid_mc.ph_mc.nextFrame();
_root.grid_mc.ph_mc.ph_btn.enabled = false;
} else if (answer.text == "one") {
message.text = "Correct! Select next question.";
_root.grid_mc.ph_mc.nextFrame();
_root.grid_mc.ph_mc.ph_btn.enabled = false;
} else if (answer.text == "ONE") {
message.text = "Correct! Select next question.";
_root.grid_mc.ph_mc.nextFrame();
_root.grid_mc.ph_mc.ph_btn.enabled = false;
} else {
message.text = "Incorrect. Try again or skip.";
}
}