Skip to main content
Inspiring
December 28, 2015
Question

Stop for setInterval

  • December 28, 2015
  • 1 reply
  • 496 views

Hi,

How can I be stopping the counter of a setInterval, which currently is being used as a stopwatch?

setInterval (stopwatch, 1000);

Thanks in advance.

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
December 28, 2015

assign it a variable:

var stopI:int=setInveral(stopwatch,1000);

and use clearInterval to stop it:

clearInterval(stopI);

vvvverTAuthor
Inspiring
December 30, 2015

But using this way and putting the clearInterval function is assigning an error when running the test could help me?

Justamente na linha na qual foi empregada a variável.

var stopI:int = setInveral (avancar, 1000);

Error:

1180: Call to a possibly undefined method setinveral

kglad
Community Expert
Community Expert
December 30, 2015

are you publishing for html5?