all groups > flash actionscript > october 2004 >
You're in the

flash actionscript

group:

Realtime Day/Night


Realtime Day/Night ekora
10/14/2004 9:01:28 PM
flash actionscript:
I'm trying to build a small corner in a project that displays realtime day or
night.

I'm basically thinking this but I'm not sure how to code it correctly:

if time >= 06:00 or <= 19:00 then gotoAndPlay ('daytime')
elseif time >= 19:01 then gotoAndPlay('night');

Anyone know how this could be done? Much obliged.

mookymook

Re: Realtime Day/Night MGladstone
10/14/2004 9:07:56 PM
Here you go.

var my_date:Date = new Date();
if (my_date.getHours() > 6 || my_date.getHours() <= 19)
gotoAndPlay("daytime");
else
AddThis Social Bookmark Button