webForumDet fria alternativet

Ändra tid i coundown i Flash?

1 svar · 478 visningar · startad av Bx Creation

Bx CreationMedlem sedan dec. 20061 inlägg
#1

Har ett litet bekymmer, har en countdown klocka i flash, som jag själv inte skapat och behöver ändra datum för nedräkning för denna. Hur gör jag? tacksam för hjälp, antar att det är ett minimalt problem för de som använder flash. Vill ändra nedräkningen till 1 januari 2008.

stop();

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

eventDate = new Date(thisYear, 04, 12, 11, 00);
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); 
this.mins = Math.floor(this.secs/60); 
this.hours = Math.floor(this.mins/60); 
this.days = Math.floor(this.hours/24); 

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);
};

Tacksam för hjälp!

mirandirMedlem sedan maj 2003750 inlägg
#2

Ändra den här raden:

eventDate = new Date(thisYear, 04, 12, 11, 00);

till:

eventDate = new Date(2008, 0, 1, 0, 0);

/Mirandir

130 ms totalt · 3 externa anrop · v20260731065814-full.30151723
127 ms — hämta forumlista (db)
0 ms — hämta statistik (cache)
127 ms — hämta tråd, inlägg och bilagor (db)