I am calling this function
function drawLayers() { //setTimeout(drawBlueSky,500); //setTimeout(drawCircle1,1250); setTimeout(drawMoon,800);
Set your stop button to set a flag (ex. stopPressed = true;). I would write a function drawNextLayer(previousLayer).
Then write
while (stopPressed === false && previousLayer !== lastLayer) { drawNextLayer(previousLayer); previousLayer++; }