2 Replies Latest reply on May 3, 2006 9:12 PM by Newsgroup_User

    pause a movie for a fixed time

    Level 7
      want to pause the movie for a fixed time using action script. Any help !!!

      rajakvk


        • 1. Re: pause a movie for a fixed time
          Peter Lorent Level 2
          You could use the following code.

          // init a counter
          var stopCounter:Number=0;

          // function to control the timing of the movie
          function pauseMovie(seconds:Number,frameNumber:Number):Void{
          stopCounter++;
          if(stopCounter>=seconds){
          clearInterval(stopInterval);
          gotoAndPlay(frameNumber);
          // reset the counter
          stopCounter=0;
          }
          }

          //usage
          //this would pause the movie for 2 seconds and then play frame 5
          var stopInterval:Number=setInterval(pauseMovie, 1000, 2, 5);
          • 2. Re: pause a movie for a fixed time
            Level 7
            Dear LuigiL,

            Thanks for that post.

            My motive is to move a circle from one place to other with a desired speed.
            For that what should I do.

            Thanks
            rajakvk

            "LuigiL" <webforumsuser@macromedia.com> wrote in message
            news:e3acii$jto$1@forums.macromedia.com...
            > You could use the following code.
            >
            > // init a counter
            > var stopCounter:Number=0;
            >
            > // function to control the timing of the movie
            > function pauseMovie(seconds:Number,frameNumber:Number):Void{
            > stopCounter++;
            > if(stopCounter>=seconds){
            > clearInterval(stopInterval);
            > gotoAndPlay(frameNumber);
            > // reset the counter
            > stopCounter=0;
            > }
            > }
            >
            > //usage
            > //this would pause the movie for 2 seconds and then play frame 5
            > var stopInterval:Number=setInterval(pauseMovie, 1000, 2, 5);
            >