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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pause a movie clip for ## seconds

Status
Not open for further replies.

ToshTrent

Technical User
Jul 27, 2003
209
Hi,

Is there a way to pause a movie clip for say 20 seconds? I'm currently making a large section in the time line with blank keyframes. If I could make an action at the end of the movie to pause for 20 seconds then play again that would be awesome. Does anyone know how?

Thank you in advance!
Tosh
 
try this code:
Code:
this.onEnterFrame = function() {
	var delay = 2;//seconds

	//use the getTimer() to get the number of milliseconds
	var gts = getTimer();

	//convert to seconds
	var theSeconds = Math.round(gts/1000);
	_root.secs.text = theSeconds; //debug to see seconds

	//if the seconds equals the delay, then go to a frame
	if (theSeconds == delay) {
		gts = 0;
		delete this.onEnterFrame;
		gotoAndPlay(1);
	}
};
stop();

The only problem i have come across is how to reset the timer. This is just a basic example of how to do it, i'm sure there are better ways of doing this.

Regards,

Martin

Computing Help And Info:
 
stop();
intervalTime = setInterval(afterInterval, 20000)

function afterInterval() {
clearInterval(intervalTime)
_root.play()
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top