I m trying to get time from user
s PC to see if it`s day or night.
the following code WORKS perfectly when I preview within flash.
BUT it only UPDATE TIME ONCE when I viewed in a web browser.
AND it updates only when I clear browser`s cash.
stage.root.addEventListener(Event.ENTER_FRAME, renew);
function renew(e:Event):void{
getTime();
}
function getTime():void{
var now:Date = new Date();
var hour:Number = now.getHours();
if (hour > 6 && hour < 18){
trace("NOW IS DAY");
// do something
}else if(hour < 8 || hour > 18){
trace("NOW IS NIGH");
// do something
}else{
trace("ERROR");
}
}
What do I need to do?
can anybody help me?
Thank you.