i need to make this countdown, when it reaches 0h 0m 0s , it goes to a new SCENE, where i got movie clips etc…
heres the code:
first frame:
today = new Date();
seconds = Math.floor((event.getTime()-today.getTime())/1000);
minutes = Math.floor(seconds/60);
hours = Math.floor(minutes/60);
days = Math.floor(hours/24);
cday = days;
if (cday<10) {
cday = ""+cday;
}
chour = hours%24;
if (chour<10) {
chour = "0"+chour;
}
cminute = minutes%60;
if (cminute<10) {
cminute = "0"+cminute;
}
csecond = seconds%60;
if (csecond<10) {
csecond = "0"+csecond;
}
//create a dynamic text named input
input = cday+"dia "+chour+"hr "+cminute+"m "+csecond+"s";
// year, month -1, day, hour
event = new Date(2002, 12, 1, 00);
the 2nd frame is just a goto first frame.
im posting the FLA also,
i need this urgently please any kind one, that wants to help me out its gonna be much appreciated.
ITSA COUNTDOWN FOR 2003 !! :S
system
December 31, 2002, 5:46pm
2
I am guessing to just tack on an if statement at the end…
if (cday<=0 && chour<=0 && cminute<=0 && csecond<=0) {
_root.gotoAndPlay("Scene", 1);
}
Didn’t test it, but that seems logical to me.
system
December 31, 2002, 6:08pm
5
Darn i was trying to testing adding today date but i couldnt but i i put 1999 or 2000 on the year it goes to the scene…
Are you sure this gonna work?
Because its a animation for a disco lol, if it dosent work :S:S:S im gonna get fired
system
December 31, 2002, 6:13pm
6
Well… Just change the time on your computer to 1 minute before the new year… then wait for it.
system
December 31, 2002, 6:19pm
8
Wel you can change the time on your computer.
Like in windows you double click the clock in the lower right corner and it opens it for editing.
Well you just change the time to something like 11:59pm on December 31st, that will read that you only have 1 minute left until midnight. Then you will just have to wait out that minute with your flash movie opened to see if it will work.
system
December 31, 2002, 6:22pm
10
LOL, no problem man. Let me know how that goes.
system
December 31, 2002, 7:12pm
11
■■■■!
is not working…
heres the FLA!
i got the new scene and added ure script, but when i run it it just pumps out and go to the AFTER THE COUNTDOWN SCENE
system
December 31, 2002, 7:42pm
12
PLEASE SOMEONE HELP ME!!!
system
December 31, 2002, 8:15pm
13
well, you’ll just be going to Midnight tonight, so your target will be 24:00:00
get today’s hours and minutes and seconds:
now = new Date()
nSecs = now.getSeconds()
nMin = now.getMinutes()
nHour = now.getHours()
nHtar = 24
then make a dynamic text boxe labeled “timeLeft” without the quotes.
timeLeft = (nHtar - nHour)+":"+(60-nMin)+":"+(60-nSecs)
that MIGHT work. I don’t have flash here, so someone else will have to test it out…
You may have to change the var nHtar to 23 instead…I’m not sure…but try it anyway…
system
December 31, 2002, 8:17pm
14
then just toss in an IF statement to test when everything reaches 0 and then GOTOANDPLAY
system
December 31, 2002, 8:18pm
15
i mean, the countdown timer is working fine, the thing that dosent work is when the timer gets to 00h 00m 00s, it dosent load the next scene.
and when it does it loads it then returns to the first scene and
starts the countdown again at 24h 00m 0s
why??
O MY DEAR GOD, HELP ME!!!
system
December 31, 2002, 8:20pm
16
fscommand("fullscreen", "true");
today = new Date();
seconds = Math.floor((event.getTime()-today.getTime())/1000);
minutes = Math.floor(seconds/60);
hours = Math.floor(minutes/60);
chour = hours%24;
if (chour<10) {
chour = "0"+chour;
}
cminute = minutes%60;
if (cminute<10) {
cminute = "0"+cminute;
}
csecond = seconds%60;
if (csecond<10) {
csecond = "0"+csecond;
}
//create a dynamic text named input
input = chour+"h "+cminute+"m "+csecond+"s";
// year, month -1, day, hour
event = new Date(2002, 12, 1, 24);
if (chour == 0 && cminute == 0 && csecond == 0) {
gotoAndPlay("2003", 1);
}
I just had to change it from <=0 to == 0… fickle things like that can be a pain.
Works perfect, I tested it. I also removed the code to get the day since you don’t use it anyway.
system
December 31, 2002, 8:21pm
17
ohhh ok. I understand now. Sorry. I have a problem of not reading things and wehn I do read them they don’t make any sense. I can’t check anything because I don’t have my computer here. Sorry. Maybe LiB can help ya…
system
December 31, 2002, 8:23pm
18
oh man, i cant get the code you gave me to work, i dont now much AS yet,
i think im gonna cry now. (for real)
:*(
system
December 31, 2002, 8:24pm
19
The code I just posted works great, just replace all the actions in your frame one with the actions above.
system
December 31, 2002, 8:25pm
20
oh man, let me check it please please please dont gooo!!!
thanks for the extreme help!