A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Delay using timer...Why it doesn't work???

  1. #1
    Junior Member
    Join Date
    Feb 2001
    Posts
    21
    Hi,

    I'm trying to do the delay for a certain movie using the getTimer function....
    The movie should play for 25 seconds then restart, the movie is 15 seconds with the delay at the end 10 seconds....the first time goes well since the timer starts from 0...But the second time doesn't, as soon as the movie ends (15 seconds) it restarts, so it doesn't set the timer to delay for another 10 seconds...

    The code goes like this:

    NewTimer=getTimer();
    if (NewTimer>OldTimer+25000){
    OldTimer=NewTimer;
    tellTarget(_root){
    gotoAndPlay(1);
    }
    }

    the Frame after it contains

    PrevFrame();
    Play();


    and both are at the end of the movie....Any suggestions?? Thanks in advance


  2. #2
    Senior Member
    Join Date
    Sep 2000
    Posts
    117
    how about putting this at the end of the movie in the root.

    Frame 1
    start=getTimer();
    Frame 2
    <nothing>
    Frame 3
    if (getTimer()-start>10000)
    gotoAndPlay(1)
    }else{
    gotoAndPlay(_currentframe-1);
    }

  3. #3
    Junior Member
    Join Date
    Feb 2001
    Posts
    21
    PeterFord....YOU ARE THE MAN...

    Thanks dude...It worked, you saved my work


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center