Timer working but not working

  • Hello all.

    I have a timer in an include file called A5SecTimer.as

    Code:
    //A FIVE SECOND TIMER THAT GOES TO THE NEXT FRAME
    function A5SecTimer(){
    setTimeout(this, "gotoAndPlay", 5000, nextFrame());
    }
    A5SecTimer();

    In my movie i reference the file in frame one of my movie as such
    #include "A5SecTimer.as"
    This works great, goes to the next frame but, when I include a new timer in the second frame
    Code:
    //A TWO SECOND TIMER THAT GOES TO THE NEXT FRAME
    function A2SecTimer(){
    setTimeout(this, "gotoAndStop", 2000, nextFrame());
    }
    A2SecTimer();
    The movie skips the second frame and goes to the third.

    This is what I'm trying to accomplish:
    -Fade in movie clip while movie is paused for 5 seconds
    -go to the next frame
    -Fade the movie clip while movie is paused for 5 seconds
    -go to next frame and stop.

    I hope this isn't too confusing to understand.

    BOOYAKASHA!

    -Atris


  • Try:
    function A5SecTimer() {
    setTimeout(this, "gotoAndStop", 5000, this._currentframe + 1);
    }
    A5SecTimer();
    //
    function A2SecTimer() {
    setTimeout(this, "gotoAndStop", 2000, this._currentframe + 1);
    }
    A2SecTimer();


  • wow, did i mention that you are the man! :mountie: