Skip to main content
Inspiring
May 3, 2006
Question

pause a movie for a fixed time

  • May 3, 2006
  • 2 replies
  • 182 views
want to pause the movie for a fixed time using action script. Any help !!!

rajakvk


This topic has been closed for replies.

2 replies

Inspiring
May 4, 2006
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);
>


Inspiring
May 3, 2006
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);