I’ve been experiencing a problem using setInterval and I’m wondering if any Flash users out there have expierienced it and/or have come across a fix for this problem. Heres a description of the layout/problem:
Flash Movie 1: I have an empty movieclip in this movie that I load Flash Movie 2 into.
Flash Movie 2: Gets loaded into Flash Movie 1 into an empty movieclip. This movie contains a setInterval action that repeats indefinitly.
I open Flash Movie 1, press the button to load Flash Movie 2, Movie 2 performs as expected. The setInterval loop performs correctly.
Next I unload Movie 2 from Movie 1. During the unload I clear the interval thats happening in Movie 2. Now while I’m still in the same session I load Movie 2 back into Movie 1. The setInterval loop seems to be going even faster then before. I unload Movie 2 and repeat - loading it back into Movie 1 and now the setInterval is going even faster.
Yet each time the Interval is cleared. Now if I reset my movie by closing and reopening it the setInterval works fine the first time - but throughout the session as the movie containing it is loaded and unloaded the interval keeps going faster and faster each time.
Is this a bug in Flash MX? Does anyone know of a cure for this?
The latter did the trick. I wouldn’t have thought clearing the Interval on the main timeline would have worked. Thanks a ton…you saved me a lot of grief.
Just stick it in a function and call the function whenever you need.If you have only used a couple of intervals in your external movie would be better to clear each individually.This is only a last resort solution.