I am calling this function
function drawLayers() {
//setTimeout(drawBlueSky,500);
//setTimeout(drawCircle1,1250);
setTimeout(drawMoon,800);
setTimeout(drawCircle1,2300);
setTimeout(drawCircle2,2700);
setTimeout(drawCircle3,3100);
setTimeout(drawCircle4,3500);
setTimeout(drawCircle5,3900);
setTimeout(drawtext2,4300);
setTimeout(drawtext,4700);
setTimeout(drawtext3,5100);
setTimeout(drawtext4,5500);
setTimeout(drawtext5,5900);
setTimeout(drawtext6,6300);
setTimeout(drawtext7,6700);
setTimeout(drawtext8,7100);
setTimeout(drawtext9,7500);
setTimeout(drawtext10,7900);
}
which calls many other functions fox ex drawMoon,drawCircle1 etc
I am calling drawLayers() function on click of play button. What I need is if someone clicks on stop button the setTimeout function should stop calling all other functions or stop wherever it is. For ex if drawMoon function is called and someone clicks on stop all other functions drawCircle1,drawCircle2 shouldnt be called.
- pause button also there would be third button which when clicked will pause the setTimeout function as above. when i click on same button again it should call function from where it has stopped.
Is this possible?