# \[CS3, AS2\] Interval Refuses to Clear!

**URL:** https://forum.kirupa.com/t/cs3-as2-interval-refuses-to-clear/283902
**Category:** flash
**Created:** [March 12, 2009, 9:54am UTC](https://forum.kirupa.com/t/cs3-as2-interval-refuses-to-clear/283902 "2009-03-12T09:54:43Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![thegrrraue](https://avatars.discourse-cdn.com/v4/letter/t/b4bc9f/32.png) [@thegrrraue](https://forum.kirupa.com/u/thegrrraue)
#### Post date: [March 12, 2009, 9:54am UTC](https://forum.kirupa.com/t/cs3-as2-interval-refuses-to-clear/283902/1 "2009-03-12T09:54:43Z")

</div>

So I have an interval that won’t clear. Here’s my code:

```auto

imageLoader._alpha = 0;
imageLoader.loadMovie("Images/Western/04.jpg");
fadeInHome();
clearInterval(delInterval);
delInterval = setInterval(fadeOutHome, 4000);

```

This is on each of six frames, the fadeOutHome includes a command to go to the next frame, each frame has a different image loaded.

It works just fine, but if I navigate away from the home page (that contains the movieclip where this occurs) and then come back, it starts creating multiple instances of delInterval.

What I have tried:  
-Putting the clearInterval command after the interval is called (which I have seen done elsewhere, but this seems to clear it before it can run in the first place).  
-Putting clearInterval commands on any of the buttons that can be used to navigate, thereby ensuring that it is called on a button press.  
-Putting the specific path to where the interval is located:

```auto

clearInterval(_root.home.delInterval);

```

What am I missing?
