# setInterval / clearInterval driving me crazy!

**URL:** <https://forum.kirupa.com/t/setinterval-clearinterval-driving-me-crazy/241165>\
**Category:** Uncategorized\
**Created:** [October 10, 2007, 5:01pm UTC](https://forum.kirupa.com/t/setinterval-clearinterval-driving-me-crazy/241165 "2007-10-10T17:01:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![natronp](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@natronp](https://forum.kirupa.com/u/natronp)\
**Post date:** [October 10, 2007, 5:01pm UTC](https://forum.kirupa.com/t/setinterval-clearinterval-driving-me-crazy/241165/1 "2007-10-10T17:01:54Z")

</div>

this conditional i have in this function works… everything traces out… .for some reason it won’t clear the setInterval!!! arrrgh!!!

```auto
_global.cTimer=function(tc)
{	
	trace("cTimer Function: "+tc);
	if(tc=="start"){
		if(sI != null){
			clearInterval(sI);
		}
		var sI:Number;
		sI=setInterval(dayOut, fadeTime);
	}else{
		trace("CTIMER FUNCTION STOP!");
		clearInterval(sI);
	}
}

```

‘dayOut’ is a \_global function. what am i doing wrong???

also, when clearing an interval, does the interval id return to null? or do i have to manually set that?
