Hey everyone,
I am creating a countdown but don’t know how to pointpoint it to a certain time, just the day. So I am aiming for 19.00 GMT on Christmas Day, but can only aim the code at midn ight on Christmas Day.
Can anyone offer any advice, tips or the code?
Thanks in advance
George
Here is the code that I’m using which I got from Kirupa and the countdown works fine!!!
currentDate = new Date();
thisYear = currentDate.getFullYear();
eventDate = new Date(thisYear, 11, 25);
eventMillisecs = eventDate.getTime();
counter.onEnterFrame = function(){
currentDate = new Date();
currentMillisecs = currentDate.getTime();
this.msecs = eventMillisecs - currentMillisecs;
if (this.msecs <= 0){
play();
return;
}
this.secs = Math.floor(this.msecs/1000); // 1000 milliseconds make a second
this.mins = Math.floor(this.secs/60); // 60 seconds make a minute
this.hours = Math.floor(this.mins/60); // 60 minutes make a hour
this.days = Math.floor(this.hours/24); // 24 hours make a second
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);
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;
for(movie in this){
if (this[movie]._parent == this) this[movie].evaluateFrameFrom(this);
}
};
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);
};