# clearInterval not clearing

**URL:** <https://forum.kirupa.com/t/clearinterval-not-clearing/154349>\
**Category:** flash\
**Created:** [July 8, 2005, 6:42pm UTC](https://forum.kirupa.com/t/clearinterval-not-clearing/154349 "2005-07-08T18:42:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![joecorr](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/joecorr/32/1486_2.png) [@joecorr](https://forum.kirupa.com/u/joecorr)\
**Post date:** [July 8, 2005, 6:42pm UTC](https://forum.kirupa.com/t/clearinterval-not-clearing/154349/1 "2005-07-08T18:42:39Z")

</div>

hallo:

here is my problem. I have a slideshow that I wish to pause when I rollOver a button, and to resume when I rollOut.

here is the the interval part of the code:

[color=Black]----------------------------------------------[/color]  
\*\*var ssInt = new Number();  
ssInt = 100;

intObj = new Object();  
intObj.newInt = function(){  
trace(“hi”);  
}

function setIt(){  
var ssInterval;  
[color=SeaGreen]ssInterval[/color] = setInterval(intObj, “newInt”,ssInt);  
trace(“set?”);  
}  
function [color=Magenta]clearIt/color{  
[color=DarkOrange] clearInterval/color;  
trace(“cleared?”);  
}

back\_mc.onRelease = function(){  
[color=Magenta]clearIt/color;  
}

setIt();  
stop();

\*\*[color=Black]----------------------------------------------

i’m putting the setInterval() and clearInterval() actions inside functions so that I can reuse them (as I would like the movie to stop when you rollover any of 3 buttons, and begin again when you rollout). if I rip the code out of the functions and paste it into the rollover/out functions of each of the buttons it works, but not when I call the setIt(), clearIt() functions outlined above. Any ideas?

thanks,  
Joe  
[/color]
