So I have an interval that won’t clear. Here’s my code:
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:
clearInterval(_root.home.delInterval);
What am I missing?