6 Replies Latest reply on Mar 26, 2007 7:07 PM by kglad

    [AS 2.0] Problem with removeMovieClip+setInterval

    Phoenix00017 Level 1
      For this movie, I'm showing a grid of symbols that appear, pause, then fade, so I can have people try to identify them quickly (for a psych experiment). I have a "Grid" that all of these "GridSymbols" are children of (currently using the DepthManager, but I'm pretty sure I had the same problem when I used getNextHighestDepth).

      I'm using a timer (via setInterval) to be able to dynamically set a time for a movie to remain visible on the screen (there is a 5 frame fade-in, then a setInterval timer on a stop() frame that after the time jumps to the fadeout frame). This works great until I need to remove all of the currently visible movies to progress to a new part of the task that I am creating. The offending code looks like this (on frame 6, after the fade):


      this.delayAmount = setInterval(goToFade, _root.SymbolVisible);

      function goToFade()

      The problem occurs when I remove the Grid (thus removing all of the GridSymbols). If however I remove the delayAmount interval and simply insert 10 static frames from 6 - 15 the program works fine, so I feel confident that it has to do with the interval (perhaps maturing after the movie has been removed and then looking for the appropriate frame to jump to). Anyone have any idea how to fix this? Or perhaps an alternate method of accomplishing the same goal?