00:00
00:00
Newgrounds Background Image Theme

TheADHX just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

I can't clear my interval!

473 Views | 1 Reply
New Topic Respond to this Topic

I can't clear my interval! 2012-05-24 18:23:33


So I have the following code more or less at the beginning of a frame:

var myTimer =setInterval (doThing,1000);

and within the doThing function, I have the following code:

if (stats[7]==0){
		clearInterval(myTimer);
		gotoAndPlay(71);
	}

And I know that stats[7] gets to zero, because it does take the user to frame 71. However, in the outputs panel (after reaching frame 71), it keeps saying something about error 1009, null, and doThing. From there I intend for the user to eventually go back to the original frame, which should start the interval again.

Now is there something I'm doing wrong, and if so, how should I fix it? Somewhat more importantly, if I let it continue running and creating errors in the background (it doesn't actually affect anything, as far as I can tell), will it cause flash to go through extreme lag after an extended period of time?


BBS Signature

Response to I can't clear my interval! 2012-05-24 18:40:47


Right, I think I figured it out. At some point while aimlessly trying to find a fix, I made an interval a few frames back that was triggering the errors.

Derp.


BBS Signature