setTimeout not working in Animate HTML5 Canvas
Hello everyone,
I am trying to use the setTimeout event in order to delay the firing of a specific function on the click of a button. This is my code, and it is simply not working. The function "playgame" is firing instantly when the button is clicked, instead of waiting the delay. What is my error? Thanks in advance! (This code and all objects are inside frame1 of my Animate timeline.)
this.stop();
setTimeout(playgame,10000);
this.Startbutton.addEventListener("click", ColorsIn.bind(this));
function ColorsIn() {
....(various other tasks that I want to execute before "playgame" function...)
playgame();
}
function playgame(){
.
.
.
}
