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