Yet another Flash Q
- Started
- Last post
- 5 Responses
- MichaelFelt
Need help getting flash to look at the users time setting, then depending on what their time is, displaying frame 1 or frame 2 in a MC.
example:
If the users time is set between 8AM-6PM it goes to and plays frame 1 in a MC (frame 1 contains blue background / daytime)but if time is between 6PM - 8AM it plays frame 2 (dark background suggesting its nite time)
any help would be sweet as!
- UndoUndo0
var now_date:Date = new Date();
var currentHour = now_date.Hours()
if (currentHour22){
//do this
} else{
// do this}
checks to see if the time is between 10 at night and 1 in the morning against the users own clock.
you can use UTC time but you have to workout the timezone offset which uses the users computer time to calcualte it. so if the users clock is wrong yr fuckered :)
- UndoUndo0
NT has removed some code
see yr mail
- MichaelFelt0
i'll give it a try, thanks for the help. I've had no responses so far so this is most welcome dude!
- unfittoprint0
var time:Date = new Date();
if(time.getHours() > 8 && time.getHours() < 18){
mc.gotoAndStop(1);
} else {
mc.gotoAndStop(2);
}
- MichaelFelt0
thanks! :)
at last I can start designing me new website!