# ! Urgent Help!

**URL:** <https://forum.kirupa.com/t/urgent-help/10414>\
**Category:** Uncategorized\
**Created:** [December 31, 2002, 4:39pm UTC](https://forum.kirupa.com/t/urgent-help/10414 "2002-12-31T16:39:25Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![thediablo](https://avatars.discourse-cdn.com/v4/letter/t/c37758/32.png) [@thediablo](https://forum.kirupa.com/u/thediablo)\
**Post date:** [December 31, 2002, 4:39pm UTC](https://forum.kirupa.com/t/urgent-help/10414/1 "2002-12-31T16:39:25Z")

</div>

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:

```php

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 31, 2002, 5:46pm UTC](https://forum.kirupa.com/t/urgent-help/10414/2 "2002-12-31T17:46:04Z")

</div>

I am guessing to just tack on an if statement at the end…

```auto
if (cday<=0 && chour<=0 && cminute<=0 && csecond<=0) {
	_root.gotoAndPlay("Scene", 1);
}

```

Didn’t test it, but that seems logical to me.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 31, 2002, 5:49pm UTC](https://forum.kirupa.com/t/urgent-help/10414/3 "2002-12-31T17:49:30Z")

</div>

ok, gonna try that one…

thanks!.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 31, 2002, 5:58pm UTC](https://forum.kirupa.com/t/urgent-help/10414/4 "2002-12-31T17:58:12Z")

</div>

I hope it works :beam:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 31, 2002, 6:08pm UTC](https://forum.kirupa.com/t/urgent-help/10414/5 "2002-12-31T18:08:28Z")

</div>

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 😛

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 31, 2002, 6:13pm UTC](https://forum.kirupa.com/t/urgent-help/10414/6 "2002-12-31T18:13:35Z")

</div>

Well… Just change the time on your computer to 1 minute before the new year… then wait for it.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 31, 2002, 6:14pm UTC](https://forum.kirupa.com/t/urgent-help/10414/7 "2002-12-31T18:14:24Z")

</div>

what u mean?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 31, 2002, 6:19pm UTC](https://forum.kirupa.com/t/urgent-help/10414/8 "2002-12-31T18:19:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 31, 2002, 6:20pm UTC](https://forum.kirupa.com/t/urgent-help/10414/9 "2002-12-31T18:20:22Z")

</div>

OH!!! LOL!!!

but of course!

i hate simple solutions 😛

lol

THANKS MAN!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 31, 2002, 6:22pm UTC](https://forum.kirupa.com/t/urgent-help/10414/10 "2002-12-31T18:22:40Z")

</div>

LOL, no problem man. Let me know how that goes.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 31, 2002, 7:12pm UTC](https://forum.kirupa.com/t/urgent-help/10414/11 "2002-12-31T19:12:16Z")

</div>

■■■■!

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 31, 2002, 7:42pm UTC](https://forum.kirupa.com/t/urgent-help/10414/12 "2002-12-31T19:42:07Z")

</div>

PLEASE SOMEONE HELP ME!!!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 31, 2002, 8:15pm UTC](https://forum.kirupa.com/t/urgent-help/10414/13 "2002-12-31T20:15:50Z")

</div>

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:

```php

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.

```php

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…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 31, 2002, 8:17pm UTC](https://forum.kirupa.com/t/urgent-help/10414/14 "2002-12-31T20:17:02Z")

</div>

then just toss in an IF statement to test when everything reaches 0 and then GOTOANDPLAY

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 31, 2002, 8:18pm UTC](https://forum.kirupa.com/t/urgent-help/10414/15 "2002-12-31T20:18:29Z")

</div>

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!!!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 31, 2002, 8:20pm UTC](https://forum.kirupa.com/t/urgent-help/10414/16 "2002-12-31T20:20:50Z")

</div>

```auto
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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 31, 2002, 8:21pm UTC](https://forum.kirupa.com/t/urgent-help/10414/17 "2002-12-31T20:21:24Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 31, 2002, 8:23pm UTC](https://forum.kirupa.com/t/urgent-help/10414/18 "2002-12-31T20:23:18Z")

</div>

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)

:\*(

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 31, 2002, 8:24pm UTC](https://forum.kirupa.com/t/urgent-help/10414/19 "2002-12-31T20:24:02Z")

</div>

The code I just posted works great, just replace all the actions in your frame one with the actions above.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 31, 2002, 8:25pm UTC](https://forum.kirupa.com/t/urgent-help/10414/20 "2002-12-31T20:25:51Z")

</div>

oh man, let me check it please please please dont gooo!!!

thanks for the extreme help!

[Next page](https://forum.kirupa.com/t/urgent-help/10414.md?page=2)
