Copy link to clipboard
Copied
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
}
*****
Copy link to clipboard
Copied
i'm not sure what you mean by ".. it blinks" but you can check to see if the text property needs to be updated before changing it:
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"
}
if(digitalClock.text!=hours + ":" + pad(minutes) + " " + ampm){
digitalClock.text = hours + ":" + pad(minutes) + " " + ampm;
}
if(dateMod.text!=day_str + ", " + month_str + " " + dateX + ", " + yearX){
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
}
*****
Copy link to clipboard
Copied
By blinking I mean, it alternates between showing the module and a black box where the module should be. I will test your suggestion and see where that gets me. Thank you very much for taking the time to help.
Copy link to clipboard
Copied
i don't know what "..the module" is.
do you have a link that shows your display and illustrates the issue?
Copy link to clipboard
Copied
I'm sorry for my lack of clarity, I am referring to the .swf file as the module as it fits into the content block within the signage player. The setup for the signage system allows us to setup content blocks within the layout. A playlist, which houses the content, is assigned to each of those content blocks. There is a 500x200 block on the layout of the player that is linked to the playlist where the .swf file for the clock lives. That block alternates between displaying the .swf file correctly and replacing it with a black box. There is a weather block above it that is also an .swf and it works correctly. I spoke with support for the system and they are saying it is a compatibility issue with my script, but they aren't offering any further recommendations. He did say that the system uses Internet Explorer to display Flash files and that my script should be compatible with IE for it to work on the system. Locally it runs fine on IE.
Copy link to clipboard
Copied
I forgot to mention that the above solution didn't fix the issue. My inability to replicate the issue locally makes me lean toward it being an issue on the player, but we have other Flash files running correctly on the player which doesn't make sense to me.
Copy link to clipboard
Copied
link?
Copy link to clipboard
Copied
There is no link that will get you to it. It is all on an internal server. I did figure out that the blinking was caused by the system thinking that the file was finished playing and moving on to the next, or in this case starting the one file over again. Adding a second keyframe with gotoAndPlay(1) lets it run in an infinite loop and the system seems to be happy with that. Thanks for your time and assistance.
Copy link to clipboard
Copied
you're welcome.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now