1 Reply Latest reply on Jun 16, 2006 3:33 PM by neil manuell

    Timelines

    Bareak
      I'm sure this is a simple problem to you gurus out there, but it's giving me a heck of a time figuring it out!

      I am trying to put a delay in a movieclip using the movieclip's timeline but I am running into problems. Sure I can throw in 100 extra frames, but I like a clean project.

      I am using the setInterval function to put in a 5 second delay. The delay works great, but when I change frames, the interval continues to run even though the movie isn't even on on the next frame it goes to! This keeps jumping me back to the first frame in the "main" timeline. I have a clearInterval in the function, and at the start of the frame in the timeline of the main movie.

      Here is the code I am using in the movieclip timeline. Movie3 is the instance name of the movie I am using.

      stop();
      delaya = setInterval(delayfun, 5000);
      function delayfun() {
      clearInterval(delaya);
      with (movie3) {
      gotoAndPlay(25);
      }
      }


      Any help would be greatly appreciated
        • 1. Re: Timelines
          neil manuell Level 1
          well looks fine from here, try putting in some traces:

          stop();
          delaya = setInterval(delayfun, 5000);
          function delayfun() {
          trace( "i am still running and delaya =)+delaya
          movie3.gotoAndPlay(25);

          clearInterval(delaya);
          }

          that should tell you whether you are scoping it correctly.
          (took the with out cause it was unneccessary and can cause scoping issues if you aint careful).

          I don't see why if the interval is still running it is jumping you back to the begining og the main time line, it should be jumping movie3 back to fram 25.
          So I think you may have a few conflicting probs... but thats just a total guess