Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pause function? 2

Status
Not open for further replies.

kitten

Technical User
May 1, 2001
64
AU
hey,
I was wondering if there was a function to pause on a specific frame for a certain period of time before continuing with the movie.

How would I do this as I can't find anywhere that states this?

thanks heaps Seeya!
Kitten ^_-
 
Hi Kitten, here's a couple of ways around the problem.

First an ActionScript routine (attach it to a button) that will pause a movie for any length of time you want. It uses the getTimer() function - all you have to do is change the value of the variable named "pause". This is best for a movie that uses loads of separate clips and doesn't have a straight timeline running through it...

on(release){
//get current time and hold it in a variable
target=getTimer();
//add 3 seconds to that target to create a pause (in milliseconds)
pause=3000
target+=pause
do{
//check current time and compare it to the pause target time
now=getTimer();
}while(now<target);
//move on!
gotoAndStop(nextFrame);
}


Alternatively you could just read your movie's frame rate and add frames to your timeline to create a pause, this is best for movies which are straight through animation from beginning to end with little scripting. If you're running at 12fps then adding 36 frames where nothing new happens will create a three second pause. The only problem with this is that if you're running on a slow machine you can't guarantee that it will play the movie at the right speed if things get complicated and your pause could reeeeeeaaalllly stretch ;-)

 
Kitten,
I guess Wangbar's solution would work attach to a button... But if you want to have an automatic pause, you'll have to rely on a &quot;pauser&quot; mc.
Check my posts in this thread250-62448 for a way to do so!

No offense Wangbar!
mywink.gif
ldnewbie
Hope that this
was helpful!
 
None taken :)

The above could also be attached as a clipEvent (as the MC is loaded for instance) or as a function so you could just call it whenever necessary.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top