bldesigns
09-23-2005, 03:17 AM
How would i reverse this so it counts from a date instead of to a date???
Help please...
currentDate = new Date();
thisYear = currentDate.getFullYear();
eventDate = new Date(1986, 4, 14);
eventMillisecs = eventDate.getTime();
counter.onEnterFrame = function ()
{
currentDate = new Date();
currentMillisecs = currentDate.getTime();
this.msecs = eventMillisecs - currentMillisecs;
if (this.msecs <= 0)
{
play ();
return (undefined);
} // end if
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;
} // end while
if (this.secs.length < 2)
{
this.secs = "0" + this.secs;
} // end if
if (this.mins.length < 2)
{
this.mins = "0" + this.mins;
} // end if
if (this.hours.length < 2)
{
this.hours = "0" + this.hours;
} // end if
while (this.days.length < 3)
{
this.days = "0" + this.days;
} // end while
for (movie in this)
{
if (this[movie]._parent == this)
{
this[movie].evaluateFrameFrom(this);
} // end if
} // end of for...in
};
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);
} // end if
};
Help please...
currentDate = new Date();
thisYear = currentDate.getFullYear();
eventDate = new Date(1986, 4, 14);
eventMillisecs = eventDate.getTime();
counter.onEnterFrame = function ()
{
currentDate = new Date();
currentMillisecs = currentDate.getTime();
this.msecs = eventMillisecs - currentMillisecs;
if (this.msecs <= 0)
{
play ();
return (undefined);
} // end if
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;
} // end while
if (this.secs.length < 2)
{
this.secs = "0" + this.secs;
} // end if
if (this.mins.length < 2)
{
this.mins = "0" + this.mins;
} // end if
if (this.hours.length < 2)
{
this.hours = "0" + this.hours;
} // end if
while (this.days.length < 3)
{
this.days = "0" + this.days;
} // end while
for (movie in this)
{
if (this[movie]._parent == this)
{
this[movie].evaluateFrameFrom(this);
} // end if
} // end of for...in
};
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);
} // end if
};