# Amending Senocular's Countdown timer

**URL:** <https://forum.kirupa.com/t/amending-senoculars-countdown-timer/162797>\
**Category:** flash\
**Created:** [September 16, 2005, 11:07am UTC](https://forum.kirupa.com/t/amending-senoculars-countdown-timer/162797 "2005-09-16T11:07:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![onemhunki](https://avatars.discourse-cdn.com/v4/letter/o/c57346/32.png) [@onemhunki](https://forum.kirupa.com/u/onemhunki)\
**Post date:** [September 16, 2005, 11:07am UTC](https://forum.kirupa.com/t/amending-senoculars-countdown-timer/162797/1 "2005-09-16T11:07:11Z")

</div>

Folks,

I’m amending Senocular’s countdown timer that he has posted both on his site and as a tutorial on this site, but I’m trying to expand it slightly and need some advice.

His counter countsdown to one specific date, I have amended that date fine but need the date to change each month specified by the variable ‘drawmonth’ to countdown to the last day of the month at 17:00 when a competition draw will be made. So far I’ve got it working for September but when I add other variables it doesn’t work.

This is a small section of the code that I know works fine:

stop();  
loadVariables(“test\_index.asp”, get);  
this.timer\_months.gotoAndStop(drawmonth);

currentDate = new Date();  
thisYear = currentDate.getFullYear();

counter.onEnterFrame = function(){  
eventDate = new Date(thisYear, 8 , 30, 17 , 00, 00, 00);  
eventMillisecs = eventDate.getTime();

```
currentDate = new Date();
currentMillisecs = currentDate.getTime();

```

}

This is counting down to 30th September at 17:00. I need to insert something like this in the function:

if (drawmonth == October){  
eventDate = newDate(thisYear, 9, 31, 17, 00, 00, 00)  
}  
if (drawmonth == November){  
eventDate = newDate(thisYear, 10, 30, 17, 00, 00, 00)  
}

etc up to March, I’ve tried this but doesn’t work.

Anyone any better ideas?

Munki
