3 Replies Latest reply on Jul 30, 2007 11:24 PM by _name

    clear interval

    jonnybennett Level 1
      I have the following code in an m.c called mcSlideshow.

      this.onUnload=function():Void{
      clearInterval(fadeOutInterval);
      clearInterval(fadeInterval);
      clearInterval(pauseInterval);}

      If mcSlideshow is attached to another m.c.,
      eg.
      mc1.mcSlideshow
      it does not always clear the intervals if you use removeMovieClip...
      there must be a global function that clears all setIntervals. Anyone?... thanks J.
        • 1. Re: clear interval
          _name Level 1
          why not remove your movieclip from the _root in combination with a function that clears your intervals?

          perhaps something like:

          function clearAll ():Void{

          // be sure to properly target the
          // clear intervals below. for instance,
          // if fadeOutInterval () is written within
          // another clip target it accordingly

          clearInterval(fadeOutInterval);
          clearInterval(fadeInterval);
          clearInterval(pauseInterval);
          }

          // use the function clearAll();
          // in conjunction with an event handler:

          movieClip.onRelease = function (){
          clearAll();
          mc1.mcSlideshow.removeMovieClip();
          }
          • 2. Re: clear interval
            jonnybennett Level 1
            Thanks for the response...I have tried just about every possible thing... I am so bored of this now it is unreal...

            If I am on mc1 that has mc2 attached to it, that has mcSlideshow attached to it.
            If I then add this code to remove movieClip 2 ..

            removeBtn.onRelease=function(){
            clearInterval(mc2.mcSlideshow.fadeOutInterval);
            clearInterval(mc2.mcSlideshow.fadeInterval);
            clearInterval(mc2.mcSlideshow.pauseInterval);
            removeMovieClip(mc2);
            }

            still does not clear INterval.

            if I try

            removeBtn.onRelease=function(){
            removeMovieClip(mc2.mcSlideshow);
            removeMovieClip(mc2);}

            to try and trigger the onUnload function...
            but still does not clear...

            clerInterval sucks.
            • 3. clear interval
              _name Level 1
              my guess is that you are improperly targeting your functions within your clearIntervals, but i can not be sure without actually getting into your file.
              is your code placed on the time line or on the movieclip (mc 1)?