Good afternoon guys,
I'm developing a screen in Animate CC, the screen is 12 buttons and when the user "clicks" on all and at the end of the counter performs the function to unlock the screen.
What is happening, is that if it clicked on only 1 button 12 times release the function, I need to make the button only add once when "clicked."
Thank you !!
Code:
var contador = 0;
function verificaAvanco() {
contador = contador + 1;
if (contador == 12)
window.parent.postMessage('destravaSlide', '*');
}
this.b1.addEventListener("click", fl_MouseClickHandler.bind(this));
function fl_MouseClickHandler() {
this.gotoAndStop('f1');
verificaAvanco();
}
this.b2.addEventListener("click", fl_MouseClickHandler_2.bind(this));
function fl_MouseClickHandler_2() {
this.gotoAndStop('f2');
verificaAvanco();
}
this.b3.addEventListener("click", fl_MouseClickHandler_3.bind(this));
function fl_MouseClickHandler_3() {
this.gotoAndStop('f3');
verificaAvanco();
}
this.b4.addEventListener("click", fl_MouseClickHandler_4.bind(this));
function fl_MouseClickHandler_4() {
this.gotoAndStop('f4');
verificaAvanco();
}
this.b5.addEventListener("click", fl_MouseClickHandler_5.bind(this));
function fl_MouseClickHandler_5() {
this.gotoAndStop('f5');
verificaAvanco();
}
this.b6.addEventListener("click", fl_MouseClickHandler_6.bind(this));
function fl_MouseClickHandler_6() {
this.gotoAndStop('f6');
verificaAvanco();
}
this.b7.addEventListener("click", fl_MouseClickHandler_7.bind(this));
function fl_MouseClickHandler_7() {
this.gotoAndStop('f7');
verificaAvanco();
}
this.b8.addEventListener("click", fl_MouseClickHandler_8.bind(this));
function fl_MouseClickHandler_8() {
this.gotoAndStop('f8');
verificaAvanco();
}
this.b9.addEventListener("click", fl_MouseClickHandler_9.bind(this));
function fl_MouseClickHandler_9() {
this.gotoAndStop('f9');
verificaAvanco();
}
this.b10.addEventListener("click", fl_MouseClickHandler_10.bind(this));
function fl_MouseClickHandler_10() {
this.gotoAndStop('f10');
verificaAvanco();
}
this.b11.addEventListener("click", fl_MouseClickHandler_11.bind(this));
function fl_MouseClickHandler_11() {
this.gotoAndStop('f11');
verificaAvanco();
}
this.b12.addEventListener("click", fl_MouseClickHandler_12.bind(this));
function fl_MouseClickHandler_12() {
this.gotoAndStop('f12');
verificaAvanco();
}