2 Replies Latest reply on Aug 26, 2007 9:38 AM by clbeech

    problems with clearInterval

    max419
      hi everyone, I have some problems with the function clearInterval.
      the problem is that clearInterval doesn't stop any setInterval set before; i have tried with the samples in the actionscript guide but nothing happens; please help me
        • 1. Re: problems with clearInterval
          Rothrock Level 5
          clearInterval() has always worked for me. You must not be using it correctly. Post your code.
          • 2. Re: problems with clearInterval
            clbeech Level 3
            yep, me too. Are you assigning an identifier? and calling to that id when using clearInterval()? is your clearInterval() call within the same scope as the setInterval()? It should look something like this:

            var int_id:Number;
            clearInterval(int_id);
            int_id=setInterval(funky, 1000);

            function funky() {
            trace('funky');
            clearInterval(int_id);
            }

            PS. best practice to call clearInterval() before assigning a new setInterval().