title: How do you stop a setInterval function?
body: <p>I have a function that I want to run at an interval within a frame.  I use the following code to start the function:</p>
  
  <pre><code>var intervalID = setInterval(intervalFunction, 3000);
  </code></pre>
  
  <p>Then, in a button's onRelease I want to stop the function.  In the onRelease, I make a transition to another frame.</p>
  
  <pre><code>btn.onRelease = function()
  {
    clearInterval(intervalID);
    gotoAndPlay("nextframe"); 
  }
  </code></pre>
  
  <p>The intervalFunction continues to execute.  What am I doing wrong?</p>