Question about countdown timer

Hey,

I was wondering if any one knows how to build a countdown timer.

I found a few tutorials about clocks and countdowns to a particular date etc. Though what I would like my website to preform things after a minute or two i.e. Suddenly play a tune or change the backdrop etc…

Would be most happy for any suggestions, links etc…

lol

you can use setInterval()…
or if you want the time shown then use a simple date function and calculate whats left ie.

timeNow = new Date()
minLeft = targetMin - timeNow.getMinutes()

and make sure you sort it out so you dont get minus minutes etc…

Prophet.

Thanks to the prophet,

though a bit more infomation would help. This setInterval() does it go into a empty mc with onClipEvent(load) or on it’s own? How would I define the time would I use a (getTimer()/1000) for that?..

Again thanks a lot for you help…

lol

did you check out the one by sen :sen: http://www.kirupa.com/developer/mx/countdown.htm
it’s easy to follow along…explinational too…

Year, thanks it’s cool “should you want to countdown to Christmas, or maybe your birthday or even the release of a new movie…” But I would like to learn how to create a counter that start when you start the movie and after a minute or two plays a frame or changes a simbol etc. :slight_smile:

Thanks macneilslt for your post.

lol

One way of doing it:

onClipEvent (load) {
	//start the timer
	var stTime = getTimer();
}
onClipEvent (enterFrame) {
	//read the timer
	var curTime = getTimer();
	//get the elapsed time in seconds
	var elapsedTime = (curTime-stTime)/1000;
	//do something after 10 seconds
	if (elapsedTime>10) {
		//do your stuff
		//(optional to start again:)
		stTimer = getTimer();
	}
}

Put that on a (empty) movieclip;)

scotty(-:

lol scotty comes up with the goods once again :wink:
sorry i couldnt be more coherant but i was in a hurry wen posting… and may i say scottys method is much better :wink:

Prophet.