Countdown to Specific Date #2

Help!

I am trying to countdown to a date next year (2005) and cannot seem to manipulate the code to make it work :slight_smile: Help!

 eventDate = new Date( 2005, 06, 16 , 18 , 0 , 0 , 0); 

What am I doing wrong? Please help.
This is Flash MX.

ok i gotta go out tonite an dunno wen ill b bak… :S
so i thout id post this 4 ya… its not 100% commented and isnt 100% accurate when months change… but aint had much time…
itd be a lot easier to just hav it counting down with months as well… but u asked for days… so i will giv u days… just u gotta giv me bit mor time im afraid… :S sorry!!

neway, heres the uncommented half code that will work… ish…
post asap wit proper version 4u…

just set a dynbamic text boxes variable to “StringCD” (without quotes) k?


	//Event Date = 16-7-2005
	EvenD = 16
	EvenM = 7
	EvenY = 2005
	monthsDays = new Array(31,28,31,30,31,30,31,31,30,31,30,31)//this is an array containing the number of days in each month...
if(StartCount!=false){
	CountDown = setInterval(Rem,1000)
	StartCount = false
}
function Rem(){
	Current = new Date()
	CY = Current.getFullYear()
	CM = Current.getMonth()+1
	CurrD = Current.getDate()
	CurrM = Current.getMinutes()
	CurrH = Current.getHours()
	while(CurrD!=Day){
		Day = CurrD
		calc = true
	}
	if(calc == true){
		LeftD = 0
		LeftMo = 0
	if(EvenY == CY){
		ML = (EvenM-CM)-1 // calculates number of FULL months remaining when the event year = current year
		if(LeftMo <0){
			LeftMo = 0
		}
	}
	else{
		ML = ((((EvenY-CY)*12)-CM)+EvenM)-1//calculates number of FULL months  remaining
	}
	LeftD = monthsDays[CM]-CurrD
	if( CM == EvenM && CY == EvenY){
		LeftD = EvenD-CurrD
	}
	else{
		LeftD += EvenD
	}
	
		MLa = ML
		for(MLb=ML;MLb!=0;MLb--){
			MLa ++
			if(MLa == 13){
				MLa = 1
			}
			LeftMo+=monthsDays[MLa+1]
			trace(MLa)
		}
		calc = false
		LeftD += LeftMo-2
	}
	
		LeftM = 60-CurrM
		if(LeftM <10){
			LeftM = "0"+LeftM
		}
		LeftH = 23-CurrH
		if(LeftH <10){
			LeftH = "0"+LeftH
		}
		StringCD = ""
		StringCD = LeftD + " Days, " + LeftH + " Hours, " + LeftM + " Minutes"
}

just stick that on the first frame… note you only want to run this script once so u mite wanna add an if(sumVar!=true){…[code above]… ; sumVar = true} in ifu have multiple frames…

sorry i cant givu finished product just yet but i really gtg… :S

Prophet.