actionscript clock

  • roarmeow
  • Professor
  • Professor
  • User avatar
  • Posts: 861
  • Loc: BKNY

Post 3+ Months Ago

just wondering... if i set up a clock on a site using
getHours
getMinutes
and
getSeconds
will it be basing the time on the server it's hosted on or on the time on the viewer's computer?

anyone?
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

The person looking at the movies' clock. ( clientside )

When you use myDate = new Date() to create a new date object it makes a connection to the users clock.

When you use any of the date objects methods, they format the milliseconds since 1970 returned from that connection for that query into your date/time. :D
  • roarmeow
  • Professor
  • Professor
  • User avatar
  • Posts: 861
  • Loc: BKNY

Post 3+ Months Ago

thanks, jb...

now... is there any way to set it up so it works off a fixed time (like greenwich time or something)?
i'm tryin'a set up clocks with the times for different cities around the world and, considering that the user could be anywhere, well, it'd be impossible to do the calculations from her/his clock...
is there anyway to work it out from the server's clock or something?

thanks,
puck
  • Jaw
  • Graduate
  • Graduate
  • User avatar
  • Posts: 132
  • Loc: Minneapolis, MN

Post 3+ Months Ago

You may want to pull the info from an xml file on another site(maybe a weather.com). I would guess that you could have php read the xml from that server and pass it in to your flash document. Intheory it should work... I haven't tested it though.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

Flash has UTC time methods :wink: Open the reference panel (shift+F1) & navigate to book - Objects > Core > Date > Methods to see them all.
Code: [ Select ]
mDate = new Date();
trace(mDate.getUTCHours());
  1. mDate = new Date();
  2. trace(mDate.getUTCHours());
  • roarmeow
  • Professor
  • Professor
  • User avatar
  • Posts: 861
  • Loc: BKNY

Post 3+ Months Ago

joebert, you are severely amazing.

peace be with you.

-puck
  • Jaw
  • Graduate
  • Graduate
  • User avatar
  • Posts: 132
  • Loc: Minneapolis, MN

Post 3+ Months Ago

I second that. JoeBert, I had no idea that existed in flash. Nice Job.

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 2 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.