Hello, help with the timer
When moving the mouse cursor is checked, if the cursor coordinate on x is less than 50, then the dx variable decreases until the OutOfRange variable does not equal to "OOR_N" (the setInterval timer is used), but as a result What is my mistake?
canvas.onmousemove = mouseMove; function mouseMove(event){ movecur(); } function movecur(){ var OutOfRange; if(curx<=50){ OutOfRange="OOR_Y"; function ChangeCanv() { timer1 = setInterval(Change(), 400); } function Change() { dx=dx-10; alert(dx); build(); if (OutOfRange=="OOR_N"){ clearInterval(timer1); } } ChangeCanv(); } build(); }