Controlling time/numbers with flash

Hi there,

I’m new to this forum - nice to meet you all! :slight_smile:

I’m currently building a flash clock screensaver, and so far have the clock showing the time correctly with the following code. What I would like to do now is start the movie 12 hours back from the current time, then fast forward (count up correctly in digits) during say the first 200 frames of the movie up to the current time.

Could anyone suggest an efficient way of doing this with script?

Thanks very much in advance for any advice/suggestions! :slight_smile:


FLASH CODE

function localTime(Event)
{
var date:Date = new Date();

var hourZero:String = new String();
var minuteZero:String = new String();
var secondZero:String = new String();

var h:Number = date.getHours();
var m:Number = date.getMinutes();
var s:Number = date.getSeconds();

if (s < 10)
{
    secondZero = "0";
}
else
{
    secondZero = "";
}

if (m < 10)
{
    minuteZero = "0";
}
else
{
    minuteZero = "";
}

if (h < 10)
{
    hourZero = "0";
}
else
{
    hourZero = "";
}

var displayTime:String = (hourZero + h + ":" + minuteZero + m + ":" + secondZero + s);

textBox.text = displayTime;
textBox.embedFonts = true;

}

stage.addEventListener(Event.ENTER_FRAME, localTime);