Basic Date/Time Display
Hello All,
I am new to Flash/Animate and I have built a Date/Time module for our digital signage system at work. It works well when I preview it and I am able to open it in several different browsers locally, but when I push it to the player, it blinks. Can anyone guide me in the right direction as to what I have done wrong? We have an .SWF file that was given to us by the manufacturer of the system that works great, but we needed to change a few details. Unfortunately, I do not have access to the .FLA used to create the working file, so I built this one from scratch. The players use Internet Explorer to display Flash animations. Please let me know if there is any more info you need from me.
Thanks,
-John
*****
import flash.utils.Timer;
var myTimer:Timer = new Timer (100);
myTimer.addEventListener(TimerEvent.TIMER, go);
myTimer.start();
updateTime();
function go(event:TimerEvent):void
{
updateTime();
}
function updateTime():void
{
var date = new Date();
var minutes:uint = date.getMinutes();
var hours:uint = date.getHours();
var dayOfWeek_array:Array = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
var day_str:String = dayOfWeek_array[date.getDay()];
var monthOfYear_array:Array = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
var month_str:String = monthOfYear_array[date.getMonth()];
var dateX:uint = date.getDate();
var yearX:uint = date.getFullYear();
var ampm
if (hours > 12)
{
hours = hours - 12
ampm = "PM"
}
else
{
ampm = "AM"
}
digitalClock.text = hours + ":" + pad(minutes) + " " + ampm;
dateMod.text = day_str + ", " + month_str + " " + dateX + ", " + yearX;
}
function pad (number:Number)
{
var new_num:String = String (number);
if (new_num.length <2)
{
new_num = "0" + new_num
}
return new_num
}
*****
