A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: timer script gone Burzurk!!!!!!

  1. #1
    Sick of the web
    Join Date
    Nov 2000
    Posts
    160

    timer script gone Burzurk!!!!!!

    Hey folks,

    I'm using a "pause" script whereby when Btn1 is pressed, a MC "navigation" slides open for 15 seconds then slides closed.

    Here's what happens, everything works fine unless the user presses Btn1 again (as we know users do) while the MC "navigation" is open. If this happens the timer script repeats endlessly causing this navigation widow to open and close over and over.

    The Btn1 (which opens the navigation) script goes as follows-

    on (release) {
    with (_root.navigation) {
    gotoAndPlay("baldness");
    }
    }


    Below is a screen shot of the MC "navigation" timeline





    After Btn1 is pressed the "navigation" timeline plays until frame "pause" (this slides open the navigation) and the following script is used to pause the timeline.

    // stop the movieclip
    _root.navigation.stop();
    // create a function that starts the movieclip again
    playMC = function () { _root.navigation.play();clearInterval(pauseMC);};
    // create a timer that starts the movieclip in 150000ms (15 seconds)
    pauseMC = setInterval(playMC, 15000);


    after the 15 seconds the timeline starts again until it hits "return" using the script.

    gotoAndStop("baldness");


    I'm not exactly sure why the timeline starts repeating over and over if the Btn1 is clicked again. I would like to know that.

    And of course any ideas on how to fix the problem or another pause script which would not do this.

    thanks
    Last edited by goldpan; 06-30-2003 at 12:26 PM.

  2. #2
    Senior Member FPChris's Avatar
    Join Date
    May 2003
    Location
    NJ
    Posts
    644
    looks like your button is across the entire animation.
    If you only use it to start the animation then only
    have the button on frame 5, not frame 6 and beyond etc.

    Is that what you mean?

    Chris
    http://www.**********-dms.com

  3. #3
    Sick of the web
    Join Date
    Nov 2000
    Posts
    160
    Actually the the button BTN1 is outside this MC on the main timeline. The button you see in the screen shot is nonfunctional at the moment.

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