problem form
Hi,
I have a very slight problem with a form.
I have in my frame0 a form to switch to frame1 :
this.stop();
var root = this;
var responseTF = this.responseTF;
var motdepassatrouver = "1234";
var input, button;
function onDrawEnd() {
input = document.getElementById("mdp");
button = document.getElementById("valider");
button.addEventListener("click", validate);
}
function validate() {
var value = input.value;
if (value === "")
responseTF.text = "MOT DE PASSE INCORRECT";
else if (value === motdepassatrouver) {
responseTF.text = "MOT DE PASSE CORRECT";
root.gotoAndStop(1);
} else {
responseTF.text = "MOT DE PASSE INCORRECT";
}
input.value = "";
}
stage.on("drawend", onDrawEnd, root, true);
Everything is working.
And in frame1 I also use this same form to switch to frame2. I changed the names of variable and function but it blocks :
var root2 = this;
var responseTF2 = this.responseTF2;
var motdepassatrouver2 = "1234";
var input2, button2;
function onDrawEnd2() {
input2 = document.getElementById("mdp2");
button2 = document.getElementById("valider2");
button2.addEventListener("click", validate2);
}
function validate2() {
var value2 = input2.value2;
if (value2 === "")
responseTF2.text = "MOT DE PASSE INCORRECT";
else if (value2 === motdepassatrouver2) {
responseTF2.text = "MOT DE PASSE CORRECT";
root2.gotoAndStop(1);
} else {
responseTF2.text = "MOT DE PASSE INCORRECT";
}
input2.value2 = "";
}
stage.on("drawend", onDrawEnd2, root2, true);
I did various tests but I can't see what is blocking.
I attached the file.
Thank you in advance for your help and answers.
Have a good day.
