Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Countdown Clock



How do I create a clock that is always counting down to a specific time? For example, I want a clock that shows hours, minutes and days and seconds counting down to say every Friday at 5:00pm.



FlashKit > Flash Help > Flash Newbies
Posted on: 02-09-2005, 11:29 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Countdown Clock (sync With Server Clock In .asp) PLEASE HELP
I used Senocular's awesome countdown clock tutorial found here:

http://www.kirupa.com/developer/mx/countdown2.htm

but I need to figure out how to sync it to my server's clock (I understand I must do this in a .asp file and then load that into flash).

Using vbscript this is what I tried, but obviously it doesn't work I think I may need to convert it completely to seconds first before bringing it into flash:

<%
Dim MyTime
MyTime=now()
response.Write("time="&MyTime)
%>

Does anyone have any ideas?

Thanks so much!

Countdown Clock
I want to run a full screen countdown clock. It needs to be able to count down to a certain time/date ie. New Years Eve etc. in large text or with variable font

Regrard,

Cian Byrne

Countdown Clock
I want to know how to do a countdown clock, but not in text. I want to incorporate a graphic instead, and i would just like to know how to start and what to do from there. I appreciate all the help i get. Thanks all.

Different Countdown Clock...
I am getting married on Sept. 1. I want to put a movie on my site that counts down to the second then, after the designated time (6 pm sept. 1) it plays a movie that says 'We've been married for..." then the clock counts up...

... I am not so good at AS. How, exactly, do I do this?

Thanks!

Countdown Clock
What is the actionscript to make a countdown clock?

Any advice, code examples or tutorial would sure be appreciated!

Countdown Clock
What is the actionscript to make a countdown clock?

Any advice, code examples or tutorial would sure be appreciated!

Countdown Clock
Hey,
I am trying to make a countdown clock, for example

starting at 20 days and counting down to the final hour.
is this hard to do??

Thanks for your help
K

Countdown Clock - Almost There
Hey all,

I just read a tutorial about a countdown clock and I've been having a hard time adding the day command. Can someone look at the code below and help me out.

seconds = myDate.getSeconds();
minutes = myDate.getMinutes();
hours = myDate.getHours();
days = myDate.getDay();
seconds2 = 59-seconds;
minutes2 = 59-minutes;
hours2 = 19-hours;
days2 = 170-days;
if (length(days2) == 1) {
days2 = "0"+days2;
}
if (length(hours2) == 1) {
hours2 = "0"+hours2;
}
if (length(minutes2) == 1) {
minutes2 = "0"+minutes2;
}
if (length(seconds2) == 1) {
seconds2 = "0"+seconds2;
}
timetil12 = (+day2+"Days "+hours2+":"+minutes2+":"+seconds2+" left until Training!");

The code is from a tutorial located here http://www.flashkit.com/tutorials/Ac...634/more2.php. I added a few new lines of code but I can't get the days to display in the countdown. I want this countdown to display the days, hours, minutes and seconds up until the event.

Thanks for the hook up

Cracker

Countdown Clock
I need to design an animated countdown clock that uses bitmapped numbers. The countdown will be based on a date that is nearly a year a way. I am abit overwhelmed by this task. Can anyone point me in the right direction?

Countdown Clock Help
can someone help me...can you tell me how to make a countdown clock...i dont want that kirupa sh*t......just tell me with your own words

btw i am trying to make a countdown to halo2

Countdown Clock
Is ther anyway to make a clock which is counting down.
I want it to count down until it comes to a special day, like this:

356 days, 11h, 33min, 12sec left untill "random text"

is there anyway to do this?

[CS3] Countdown Clock
I've been trying to find just a simple countdown clock. I just don't know the code for it. It's the only thing I need for my game, and I'll be done. Thanks!

Clock Countdown
Apologies if this is a really obvious question...I'm very tired as I've been working for the last 18 hours straight.

A client has requested a "countdown" to the launch of their website. I'm absolutely fine with the displaying of a clock but I'm not quite sure about the math behind the whole thing - can anybody throw some light on the situation? I just can't get my head around it at the moment!

Many Thanks in Advance

Countdown Clock HELP
I need to set up a countdown clock that does not follow your computer clock. This event takes place Jan 20th 12:00am PST, and it needs to appear to take place at 12am PST from the East Coast or another country.
Does anyone out there know how this can be done?

Thanks!

Countdown Clock?
I work at a tv station, and we're going live for 4 hours on New Year's Eve. The producer wants a countdown clock, and I was wondering if there was a semi-simple way to do this in Flash? Thanks!

Countdown Clock
Hello,

I was told to ask this question here.

I am new to creating websites. I just made my homepage using FrontPage 2002. I want to add a countdown clock that will count down to a certain date with days, hours and minutes listed. I want to have it shown on my homepage. Is there any way to do this using FrontPage? Can someone tell me how to do this with or without FrontPage?

Thanks,

John

Countdown Clock
hello,

actually i have seen the tutorial on countdown to Christmas. but i would like to have some more to this, i mean i want a countdown clock which can work for years. in the tutorial given it shows a message after reaching the specified time and it continuous to show it at all times after the date.

in my site i want it to continue for years with out manually updating the year, i mean when it reaches the specific time it should show a message and when that particular date is over it should start counting down from the coming Christmas, ie., the coming year.


some one there please help me in this. i am not that good at scripting.

looking forward to hear your valuable suggestions.

thanks and regards,
jeev

Countdown Clock
I just made a binary clock yesterday (here, and one with a readout). They have a few bugs, but that's okay. I would like to make a binary countdown clock now. I followed senocular's tutorial on making a countdown timer, but it didn't work. I need someone to help me make a countdown timer, and if possible make it use individual units of time, not just milliseconds, for the calculations. The problem with his tutorial that keeps me from changing the code to fit my needs is that it converts the numbers into a string and changes the numbers accordingly. I need to change the alpha of an mc depending on if the number goes into the binary form of the time left until the event. When I made my clock, I knew that the time could never go under 1:00:00, and never over 23:59:59. All I did was made each "light" check what the value was, and if it needed to be "on" or "off", and then changed it accordingly. The code in each "light" is about 115 lines. Imagine making a check for each value if the event date is a year away! I can't attach a *.fla for my clock, because it is too big, but it's located here. Please respond ASAP!!

Countdown Clock?
What is the actionscript code to put a countdown clock on a game? Can anyone help me out? Thanks.

Countdown Clock
Hi
i am working on a website that includes a monthly countdown clock to a lottery draw.
To achieve this i have used a video tutorial from learnflash.com and th code as below:

this.onEnterFrame = function() {

var todayate = new Date();
var currentYear = today.getFullYear();
var currentTime = today.getTime();

var targetDateate = new Date(2008,2,30);
var targetTime = targetDate.getTime();

var timeLeft = targetTime - currentTime;

var sec = Math.floor(timeLeft/1000);
var min = Math.floor(sec/60);
var hrs = Math.floor(min/60);
var days = Math.floor(hrs/24);
sec = string(sec % 60);
if (sec.length < 2) {
sec = "0" + sec;
}
min = string(min % 60);
if (min.length < 2) {
min = "0" + min;
}
hrs = string(hrs % 24);
if (hrs.length < 2) {
hrs = "0" + hrs;
}
days = string(days);

var counter:String = days + ":" + hrs + ":" + min;
time_text.text = counter;
}

i was wondering if anyone knew how to edit this so that i can specify a time on the target date...at the moment it counts down to the day itself ie. midnight the day before. If i wanted to specify midday or something how might i do this?

thanks.

Help With A Countdown Clock
Hi, I'm trying to create a countdown clock but I'm getting an error when I export my FLA. I used an online tutorial that I found here:
http://www.oman3d.com/tutorials/flas.../countdown.php

I appreciate any help anyone can provide...Here's my code:


Code:
this.onEnterFrame = function() {

var today:Date = new Date();
var currentYear = today.getFullYear();
var currentTime = today.getTime;

var targetDate:Date = new Date(CurrentYear,3,13)
var targetTime = targetDate.getTime();

var timeLeft = targetTime - currentTime;

var sec = Math.floor(timeLeft/1000);
var min = Math.floor(sec/60);
var hrs = Math.floor(min/60);
var days = math.floor(hrs/24);
sec = string(sec % 60);
if (sec.length < 2) {
sec = "0" + sec;
}
min = string(min % 60);
if (min.length < 2) {
min = "0" + min;
}
hrs = string(hrs % 24);
if (hrs.length < 2); {
hrs = "0" + hrs;
}
days = string(days);

var counter:String = days + ":" + hrs + ":" + min + ":" + sec;
time_txt.text = counter;

}

Countdown Clock
Hello,

I was told to ask this question here.

I am new to creating websites. I just made my homepage using FrontPage 2002. I want to add a countdown clock that will count down to a certain date with days, hours and minutes listed. I want to have it shown on my homepage. Is there any way to do this using FrontPage? Can someone tell me how to do this with or without FrontPage?

Thanks,

John

Countdown Clock
hello,

actually i have seen the tutorial on countdown to Christmas. but i would like to have some more to this, i mean i want a countdown clock which can work for years. in the tutorial given it shows a message after reaching the specified time and it continuous to show it at all times after the date.

in my site i want it to continue for years with out manually updating the year, i mean when it reaches the specific time it should show a message and when that particular date is over it should start counting down from the coming Christmas, ie., the coming year.


some one there please help me in this. i am not that good at scripting.

looking forward to hear your valuable suggestions.

thanks and regards,
jeev

Countdown Clock
I just made a binary clock yesterday (here, and one with a readout). They have a few bugs, but that's okay. I would like to make a binary countdown clock now. I followed senocular's tutorial on making a countdown timer, but it didn't work. I need someone to help me make a countdown timer, and if possible make it use individual units of time, not just milliseconds, for the calculations. The problem with his tutorial that keeps me from changing the code to fit my needs is that it converts the numbers into a string and changes the numbers accordingly. I need to change the alpha of an mc depending on if the number goes into the binary form of the time left until the event. When I made my clock, I knew that the time could never go under 1:00:00, and never over 23:59:59. All I did was made each "light" check what the value was, and if it needed to be "on" or "off", and then changed it accordingly. The code in each "light" is about 115 lines. Imagine making a check for each value if the event date is a year away! I can't attach a *.fla for my clock, because it is too big, but it's located here. Please respond ASAP!!

Countdown Clock
I was wondering how complicated it would be to make a Flash countdown clock like : http://www.earthday.net/countdown.aspx

Are there any samples available on the web.

Thanks!

Countdown Clock
can anyone help me?? i need to do a countdown like the one 2advanced made to introduce v4 ...

does anyone of a tutorial...?

thanks in advance guys

Countdown Clock
Hi everyone,
This has probably been asked before: what is a good way to create a countdown clock, using Actionscript, Flash 5?

Need Countdown Clock To NYE Jan 2002
Hi Everyone,

Wonder if anyone has the script or can direct me to where I can find a clock that is counting down to January 2002? Need it for a clients website, but I am just starting to get to grips with hardcore flash 5 actionscript...can anyone point me in the right direction?

Cheers,

Rick UK

Countdown Clock In Flash?
Hi!
I need a .fla file that work as a countdown clock. Maybe a open source file or a tutorial ... someone?!

Countdown Clock In Flash 5/MX
Hello everyone,

I was wondering how to write a ActionScript that counts down to a certain date. I have no problem writing the script only using hours, minutes, seconds... But lets say that the countdown should start on a 120 days until event x...How do I define Months, seeing that they do not all have the same amount of days in them? What would be the easiest way to go about this?

Thanks already for any answers,

Gene

Can't Terminate Countdown Clock At 0:00
Help a newbie please.

I got a script for a simple countdown clock from a flashkit search. I can't get it to stop at zero and goto frame x.

It seems simple. But I've put 8hrs of simple to the test.

here is part of the code for a single frame script.

onClipEvent (load) {
var start = getTimer();
this.minutesleft = _root.minutes;
this.secondsleft = _root.seconds;
}
onClipEvent (enterFrame) {
elapsed = getTimer()-start;
if (elapsed<1000) {
} else {
start = getTimer();
elapsed -= 1000;
this.secondsleft -= 1;
if (this.secondsleft<0) {
this.secondsleft += 60;
this.minutesleft -= 1;
}
}
}
Thanks!

Countdown Clock Issues
Hi all,
I'm putting a countdown clock on a wedding site. I got the code below from Flashkit. It works some of the time. I'm learning a lot about actionscript, but this is pretty advanced for me.
I think the reason it works only some of the time is because of the "daysRound = daysRound - 31" line... since every month doesn't have 31 days...
Can anyone tell me how to fix it!


PHP Code:




shift = new Date();
now = shift.getTime();
shiftchange = new Date(Number(_root.weddingYear),_
Number(_root.weddingMonth), Number(_root.weddingDay), 0);
days = (shiftchange-now)/1000/60/60/24;
daysRound = Math.floor(days);
hours = (shiftchange-now)/1000/60/60-(24*daysRound);
hoursRound = Math.floor(hours);
minutes = (shiftchange-now)/1000/60-(24*60*daysRound)-(60*hoursRound);
minutesRound = Math.floor(minutes);
seconds =_ (shiftchange-now)/1000-(24*60*60*daysRound)-(60*60*hoursRound)-(60*minutesRound);
secondsRound = Math.round(seconds);
hoursRound = (hoursRound>=10 ? hoursRound : "0"+hoursRound);
minutesRound = (minutesRound>=10 ? minutesRound : "0"+minutesRound);
secondsRound = (secondsRound>=10 ? secondsRound : "0"+secondsRound);
daysRound = daysRound-31;
dayfield = (daysRound);
hourfield = (hoursRound);
minfield = (minutesRound);
secfield = (secondsRound);






Thanks for your time.

External Var And Countdown Clock
Hello,

I have a countdown timer using this script, living on the movie clip that it is controlling:

onClipEvent(enterFrame) {
myDate = new Date(); // now
endDate = new Date(2003,9,4); // the date to count down to note months are from 0 to 11
milliseconds = endDate - myDate // milliseconds until the end date
days = (((milliseconds / 1000) / 60) / 60) / 24;
actualDays = Math.floor(days); // just use the integer part of the days
remain = days - actualDays; // the bit that's left when the whole number days are removed
hours = remain * 24; // convert this to hours
actualHours = Math.floor(hours); // and again just take the integer part
remain = hours - actualHours; // whats left
minutes = remain * 60; // convert the remainder to minutes
actualMinutes = Math.floor(minutes); // and so on
remain = minutes - actualMinutes;
seconds = remain * 60;
actualSeconds = Math.floor(seconds);
actualDays = (actualDays > 99) ? actualDays : "0" + actualDays;
actualDays = (actualDays > 9) ? actualDays : "00" + actualDays;
actualHours = (actualHours > 9) ? actualHours : "0" + actualHours; // if the hours remaining is less than 10, pad it with a leading zero, eg 09
actualMinutes = (actualMinutes > 9) ? actualMinutes : "0" + actualMinutes; // and for minutes
actualSeconds = (actualSeconds > 9) ? actualSeconds : "0" + actualSeconds; // and seconds
this.day.day.disday = actualDays;
this.hour.hour.dishours = actualHours;
this.minute.minute.disminutes = actualMinutes;
this.second.second.disseconds = actualSeconds; // how you format the display is up to you
}

The client wants to be able to change the 'endDate' in the event that it changes, via a text file. I set up a text file (just called date.txt) that has this in it:

&theDate=2003,9,4

and went back into my flash file and put a

loadVariables("date.txt", "");

on the first frame, and then in the script on the movie clip, changed this line:

endDate = new Date(2003,9,4);

to this line:

endDate = new Date(theDate);

Alas, it didn't work. any thoughts? this is really driving me nuts.

Thanks!!

Sarah

Please Help External Var And Countdown Clock
Hello,

I have a countdown timer script, living on the movie clip that it is controlling:

onClipEvent(enterFrame) {
myDate = new Date(); // now
endDate = new Date(2003,9,4); // the date to count down to note months are from 0 to 11
milliseconds = endDate - myDate // milliseconds until the end date
days = (((milliseconds / 1000) / 60) / 60) / 24;
actualDays = Math.floor(days); // just use the integer part of the days
remain = days - actualDays; // the bit that's left when the whole number days are removed
hours = remain * 24; // convert this to hours
actualHours = Math.floor(hours); // and again just take the integer part
remain = hours - actualHours; // whats left
minutes = remain * 60; // convert the remainder to minutes
actualMinutes = Math.floor(minutes); // and so on
remain = minutes - actualMinutes;
seconds = remain * 60;
actualSeconds = Math.floor(seconds);
actualDays = (actualDays > 99) ? actualDays : "0" + actualDays;
actualDays = (actualDays > 9) ? actualDays : "00" + actualDays;
actualHours = (actualHours > 9) ? actualHours : "0" + actualHours; // if the hours remaining is less than 10, pad it with a leading zero, eg 09
actualMinutes = (actualMinutes > 9) ? actualMinutes : "0" + actualMinutes; // and for minutes
actualSeconds = (actualSeconds > 9) ? actualSeconds : "0" + actualSeconds; // and seconds
this.day.day.disday = actualDays;
this.hour.hour.dishours = actualHours;
this.minute.minute.disminutes = actualMinutes;
this.second.second.disseconds = actualSeconds; // how you format the display is up to you
}

The client wants to be able to alter the 'endDate' in the event that it changes, via a text file. I set up a text file (just called date.txt) that has this in it:

&theDate=2003,9,4

and went back into my flash file and put a

loadVariables("date.txt", "");

on the first frame of the main timeline, and then in the script on the movie clip, changed this line:

endDate = new Date(2003,9,4);

to this line:

endDate = new Date(theDate);

Alas, it didn't work. any thoughts? this is really driving me nuts.

Thanks!!

Help Please..countdown Clock Lost A Day Somewhere..
This is the script for a countdown clock that is supposed to countdown to Oct63. I downloaded this from the forum here and it was working fine for a week. I noticed on Friday it lost a day somewhere and I can't see anything in the script that might have done this...My friend in Australia also had the same problem. I am using Flash MX, thinking that maybe the script might be for an earlier version ? thanks }


onClipEvent(enterFrame) {
myDate = new Date(); // now
endDate = new Date(2003,9,6); // the date to count down to note months are from 0 to 11
milliseconds = endDate - myDate; // milliseconds until the end date
days = (((milliseconds / 1000) / 60) / 60) / 24;
actualDays = Math.floor(days); // just use the integer part of the days
remain = days - actualDays; // the bit that's left when the whole number days are removed
hours = remain * 24; // convert this to hours
actualHours = Math.floor(hours); // and again just take the integer part
remain = hours - actualHours; // whats left
minutes = remain * 60; // convert the remainder to minutes
actualMinutes = Math.floor(minutes); // and so on
remain = minutes - actualMinutes;
seconds = remain * 60;
actualSeconds = Math.floor(seconds);
actualHours = (actualHours > 9) ? actualHours : "0" + actualHours; // if the hours remaining is less than 10, pad it with a leading zero, eg 09
actualMinutes = (actualMinutes > 9) ? actualMinutes : "0" + actualMinutes; // and for minutes
actualSeconds = (actualSeconds > 9) ? actualSeconds : "0" + actualSeconds; // and seconds
display = " " + actualDays + " Days... " + actualHours + " Hours... " + actualMinutes + " Minutes... " + actualSeconds + " Seconds... "; // how you format the display is up to you
}

Interactive Countdown Clock
Does anyone have info on how to make a scoreboard type timer?
I need to make a countdown clock that i can start, pause, & reset by clicking on it.
the other problem is, i need 4 seperate clock running at the same time with different countdown numbers.....
any ideas?
(this is a scoreboard i'm going to be projecting onto a screen at my roller derby teams first scrimmage)
www.derbydolls.com

hope someone can help me out!
Thanks guys
~amy
#46 crybaby

Flash Countdown Clock
Hello All,

I'm in need of a Flash Countdown clock. Something that I can customize, change colors, and bg images etc. Would anyone be interested in creating a .fla file. I would give you back a link on the website that I will use it on. Send me a PM if you're interested. Website is a good pageview producing site in NYC.

-Thanks

Analogue Countdown Clock
Howdy all,

I've been surfing around trying to find a tutorial or an open source file, on how to make an analogue clock tick backwards to a defined date/time. Maybe even with a shorter day 'hand'.

There's some really good digital looking ones out there, but me being the difficult person I am, it has to be analogue.

Any and all help will be greatly appreciated. Good karma cometh your way.

Analogue Countdown Clock
Howdy all,

I've been surfing around trying to find a tutorial or an open source file, on how to make an analogue clock tick backwards to a defined date/time. Maybe even with a shorter day 'hand'.

There's some really good digital looking ones out there, but me being the difficult person I am, it has to be analogue.

Any and all help will be greatly appreciated. Good karma cometh your way.

Countdown Clock - To Next Year...help
I am currently goning to use the countdown script that is a tutorial on this website. I am running into one problem though. How do you make it work so that I can countdown to a date and time of next year?

Thanks everyone in advance!

-bill

Countdown Clock From Server...
Iīve followed the countdown tutorial found here but I have to make the clock follow the server clock instead of the userīs computer clock. How to do it?

48 Hour Clock Countdown ?
need to have a countdown from 48 hrs to 0 rather than 1day 23hours etc.
any suggestions appreciated

Timer/countdown Clock Help
sup guys i gotta clock that goes from 60seconds-0seconds
thats the code it works fine
but i cant find out how to make it go to the next scene when it hits zero i tried code 2 but it doesnt work

//CODE1
counter = 60;
setInterval(countDown, 1000);
function countDown() {
counter--;

//CODE2
counter = 60;
setInterval(countDown, 1000);
function countDown() {
counter--;
if (counter=0) {
gotoAndStop("level2info");

Countdown Clock To Every Wednesday
HI all,

this is my first post in this forum and i'm having a problem with a countdown clock.
I want to make a countdown clock that will countdown to wednesday 20.00h and after that it has to start all over again till the next wednesday.

Can anybody help me with this?

Here is the code that i used in the counter:

onClipEvent (load) {
countdown = "yes";
// Target Time Information
tday = 18;
thours = 20;
tminutes = 00;
tseconds = 0;
//
}
onClipEvent (enterFrame) {
if (countdown == "yes") {
now = new Date();
ndays = daysinmonth[now.getMonth()];
nday = now.getDate();
nhours = now.getHours();
nminutes = now.getMinutes();
nseconds = now.getSeconds();
// Day Code
if (tday>=nday) {
rday = tday-nday;
} else {
rday = (ndays-nday)+tday;
rmonth = rmonth-1;
if (rmonth<0) {
ryear = ryear-1;
rmonth = 12+rmonth;
}
}
// Hour Code
if (thours>=nhours) {
rhours = thours-nhours;
} else {
rhours = (24-nhours)+thours;
rday = rday-1;
if (rday<0) {
rmonth = rmonth-1;
rday = Number(ndays)+Number(rday);
if (rmonth<0) {
ryear = ryear-1;
rmonth = 12+rmonth;
}
}
}
// Minute Code
if (tminutes>=nminutes) {
rminutes = tminutes-nminutes;
} else {
rminutes = (60-nminutes)+tminutes;
rhours = rhours-1;
if (rhours<0) {
rday = rday-1;
rhours = 24+rhours;
if (rday<0) {
rmonth = rmonth-1;
rday = Number(ndays)+Number(rday);
if (rmonth<0) {
ryear = ryear-1;
rmonth = 12+rmonth;
}
}
}
}
// Seconds Code
if (tseconds>=nseconds) {
rseconds = tseconds-nseconds;
} else {
rseconds = (60-nseconds)+tseconds;
rminutes = rminutes-1;
if (rminutes<0) {
rhours = rhours-1;
rminutes = 60+rminutes;
if (rhours<0) {
rday = rday-1;
rhours = 24+rhours;
if (rday<0) {
rmonth = rmonth-1;
rday = Number(ndays)+Number(rday);
if (rmonth<0) {
ryear = ryear-1;
rmonth = 12+rmonth;
}
}
}
}
}
// Countdown Checker
if (ryear<0) {
disday = 0;
dishours = 0;
disminutes = 0;
disseconds = 0;
discountdown = "no";
this.play();
countdown = "no";
} else {
// Update Clock Check
if (rday ne day) {
day = rday;
if (day<10) {
this.days.days.disday = "0"+day;
} else {
this.days.days.disday = day;
}
this.days.play();
}
if (rhours ne hours) {
hours = rhours;
if (hours<10) {
this.hour.hour.dishours = "0"+hours;
} else {
this.hour.hour.dishours = hours;
}
this.hour.play();
}
if (rminutes ne minutes) {
minutes = rminutes;
if (minutes<10) {
this.minute.minute.disminutes = "0"+minutes;
} else {
this.minute.minute.disminutes = minutes;
}
this.minute.play();
}
if (rseconds ne seconds) {
seconds = rseconds;
if (seconds<10) {
this.second.second.disseconds = "0"+seconds;
} else {
this.second.second.disseconds = seconds;
}
this.second.play();
}
}
}
}

thanx in advance!

Countdown Clock Help/Query If Possible?
Hello,

I did some searching and couldn't find anything to what I'm about to describe. I was wondering if anyone knew of a Countdown Clock Script for 20 minutes. I'm working on a game for an elementary class, and each segment of the game is 20 minutes long. Is there a way to make a countdown like this? And how would I apply the script to an instance (text field)?

Or if anyone has a link or file that can teach me this I would be very thankful. I am using Flash 8.

Richard

Analogue Countdown Clock
Howdy all,

I've been surfing around trying to find a tutorial or an open source file, on how to make an analogue clock tick backwards to a defined date/time. Maybe even with a shorter day 'hand'.

There's some really good digital looking ones out there, but me being the difficult person I am, it has to be analogue.

Any and all help will be greatly appreciated. Good karma cometh your way.

New Numberset For Countdown Clock?
Hi, I am trying to make the countdown clock as seen here in this tutorial run a seperate number set for the seconds and milliseconds values. I have duplicated the 'numbers' movie clip, renamed and changed the frame values within but can't seem to be able to make the code for the new instance of 'counter' run this new 'numbers2' movie clip. Any help would be much appreciated. I am new to flash but I assume the solution is glaringly obvious.


Quote:




So, for this thing to function we need it to dissect the name of each movie as we have so cautiously and carefully preplanned and find out which number value and ultimately which frame each numbers movieclip is to display. The names, if you'll remember, are made up of the variable they use and the character in the variable they represent (a reason for making sure each value had the right number of digits). With that information we can snag the value of the variable as a string (this is the variable as its stored in the counter movieclip - its passed as an argument so that variable can be accessed from it), then use charAt and with the correct character number to find out which number it should show. Add 1 to that number and you have a frame to go to (remember 0 is on frame one, so all frames are offset by 1).





Code:
MovieClip.prototype.evaluateFrameFrom = function(variableClip){
var nameArray = this._name.split("_");
var numberSet = variableClip[nameArray[0]];
var character = number(nameArray[1]);
var frame = 1 + number(numberSet.charAt(character));
if (this._currentframe != frame) this.gotoAndStop(frame);
};
------------------------------------------
FULL CODE HERE:


Code:
// stop the timeline
stop();

// first get this current year so this example
// remains valid for some time to come
currentDate = new Date();
thisYear = currentDate.getFullYear();

// define the event date counting down to
// this is constant so it won't need to be
// calculated in the onEnterFrame function below
// currently counting down 'til christmas of 2003
// Date( year, month-1, date [, hour [, minute [, second [, millisecond]]]])
eventDate = new Date(thisYear, 11, 25);
eventMillisecs = eventDate.getTime();

counter.onEnterFrame = function(){
// get the current date and time as it exists at
// this instance in time when the frame is entered
currentDate = new Date();
currentMillisecs = currentDate.getTime();

// the milliseconds between the current time and the
// time of the event can then be calculated by simply
// subtracting the current time's milliseconds from the
// milliseconds of the time of the event
this.msecs = eventMillisecs - currentMillisecs;

// if the msecs variable is less than 0, that means the
// current time is greater that the time of the event
if (this.msecs <= 0){
// and the event time has been reached!
// play the next frame for the result of the countdown.
play();
// a return can be used to exit the function since
// in going to the next frame, there's no need to
// continue with the remaining operations.
return;
}

// if the date hasn't been reached, continue to
// devise seconds, minutes, hours and days from
// the calculated milliseconds
this.secs = Math.floor(this.msecs/1000); // 1000 milliseconds make a second


// make sure each value doesn't exceed the range in
// which they exist. Milliseconds, for example, will
// be shown in a range of 0 - 999. The modulous
// operator, or %, well help in that. Here the values
// are also turned into strings preparing for the next step
this.msecs = string(this.msecs % 1000);
this.secs = string(this.secs % 60);
this.mins = string(this.mins % 60);
this.hours = string(this.hours % 24);
this.days = string(this.days);

// add on leading zeros for all the number values (which are
// now strings) that aren't 3 or 2 characters long based on the
// range being used to represent them. Because mseconds and
// days have up to 3 characters, a while loop is used to
// continuously add 0s until they have 3. Other values which
// only need 2 leading 0s can get by on a single if check
while (this.msecs.length < 3) this.msecs = "0" + this.msecs;
if (this.secs.length < 2) this.secs = "0" + this.secs;
if (this.mins.length < 2) this.mins = "0" + this.mins;
if (this.hours.length < 2) this.hours = "0" + this.hours;
while (this.days.length < 3) this.days = "0" + this.days;

// finally, display your values. If you want to put your values
// in a textField, you can pretty much just stop here and throw them
// into your textField as desired. This example, however will go a step
// further and use images for numbers for each numerical value in the
// countdown to the desired date.

// So, for that, loop through all the movies in this counter clip using the
// evaluateFrameFrom prototype method on each. A single check for a
// _parent variable is used to make sure the property found in a for
// loop is a movieclip and is within the timeline of this counter clip.
// TextFields and buttons would also be true here, but since the contents
// within counter are strictly those numbers movieclips, we won't have to
// be concerned with such complications. The only movieclips in this counter
// clip are the numbers movieclips with the frames of the imagery making up
// the numbers of 0-9.
for(movie in this){
if (this[movie]._parent == this) this[movie].evaluateFrameFrom(this);
}
};

// this function is a MovieClip.prototype meaning its available to be used by
// all movieclips. It's a sneaky function that saves a lot of work by using
// name each numbers movieclip in the counter movieclip to determine which value
// it needs to display based on the times derived from the previous
// calculations of the onEnterFrame. What it does is seperates a movieclip's
// _name into a variable word and a number. The variable word will represent
// the variable to look up a value for in the passed variableClip and the
// number will be used to get a character from that value (a string) which
// represents which number this movieclip should display.
MovieClip.prototype.evaluateFrameFrom = function(variableClip){
// split this _name into an array of 2 values seperated by an underscore
var nameArray = this._name.split("_");
// the first value represents what variable in variableClip (counter clip)
// this movieclip is used to represent whether it be mins or hours etc.
var numberSet = variableClip[nameArray[0]];
// next a number representing which character in that first value this
// movieclip should display. this will be between 0 and 2 (any one of
// three values). number() is used to force it to be a number value.
var character = number(nameArray[1]);
// a frame number can then be derived from the value of the numberset
// variable based on the character defined by character. number() is
// used to force it to a number value and 1 is added to offset the
// frame value by one since 0 is at frame 1 and 1 at frame 2 etc.
var frame = 1 + number(numberSet.charAt(character));
// if the movieclip is not already at the frame, move it there!
if (this._currentframe != frame) this.gotoAndStop(frame);
};

// an example of the above function in action would be for a movieclip
// with the name "days_1". days_1 is seperated into an array by dividing
// the name by its "_" character giving "days" (nameArray[0]) and "1" (nameArray[1]).
// The value of days is then retrieved from the passed variableClip using
// associative array ssntax and is set to numberset. The value of days in variableClip
// would be a string something along the lines of "045". character is then used
// to get which of those 3 values this movieclip is to represent. It is just
// nameArray[1] turned into a number or "1" to 1. So, charAt(1) of "045" would
// be 4. Turn that into a number and add one and you get frame 5 where the image of
// the 4 is located. The movieclip, days_1, is then played to that frame to show it.

Countdown Clock - To Next Year...help
I am currently goning to use the countdown script that is a tutorial on this website. I am running into one problem though. How do you make it work so that I can countdown to a date and time of next year?

Thanks everyone in advance!

-bill

Countdown Clock From Server...
Iīve followed the countdown tutorial found here but I have to make the clock follow the server clock instead of the userīs computer clock. How to do it?

Copyright Đ 2005-08 www.BigResource.com, All rights reserved