1 Reply Latest reply on May 10, 2006 11:20 AM by TimSymons

    setInterval

    kyugawa
      I am running a set Interval function repeatedly to move certain objects. I believe that I am clearing all intervals but it seems that the system drastically slows when left on for more than a few minutes. Here is the following code:

      if anyone has an idea on what I'm doing wrong please let me know. Thanks!
      k
        • 1. Re: setInterval
          TimSymons Level 1
          Not sure where the reference of "removeMC" is from. If the "removeMC" movie contains the "obj" movieclip then if you remove the movieclip first, the "obj.movieInterval" variable no longer exists and you will not be able to clear the interval associated with it.

          It may be that you just need to swap the 2 statements so they read:

          clearInterval(obj.moveInterval);
          removeMC.removeMovieClip();

          I also assume that if you uncomment the "trace" statments you see each one when expected. If not, you may want to change your conditions to "<=" instead of "==".

          Tim