# Setting Time in flash?

**URL:** <https://forum.kirupa.com/t/setting-time-in-flash/221546>\
**Category:** Uncategorized\
**Created:** [April 5, 2007, 1:39am UTC](https://forum.kirupa.com/t/setting-time-in-flash/221546 "2007-04-05T01:39:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![feilhk](https://avatars.discourse-cdn.com/v4/letter/f/3da27b/32.png) [@feilhk](https://forum.kirupa.com/u/feilhk)\
**Post date:** [April 5, 2007, 1:39am UTC](https://forum.kirupa.com/t/setting-time-in-flash/221546/1 "2007-04-05T01:39:50Z")

</div>

is there any ways for me to load time from Observatory , if it cant not be connected, then load server time .

i’ve tried something like this but the output is undefined …

```auto

mydate = new Date();
hkotime = new LoadVars();
hkotime.sendAndLoad(basehref+"server_time_hko.php", hkotime, "POST");
hkotime.onLoad = function(success) {
 if (success) {
  if (hkotime.hkosecond_s != null && hkotime.hkominute_s != null && hkotime.hkohour_s != null) {
   seconds = hkotime.hkosecond_s;
   minutes = hkotime.hkominute_s;
   hours = hkotime.hkohour_s;
   time = "HKO:"+(hours)+":"+(minutes)+":"+(seconds);
  }
 } else {
  servertime.sendAndLoad(basehref+"server_time_server.php.php", servertime, "POST");
  servertime.onLoad = function(success) {
   if (success) {
    if (servertime.serhour_s!= null && servertime.serminute_s != null && servertime.sersecond_s != null) {
     seconds = servertime.sersecond_s;
     minutes = servertime.serminute_s;
     hours = servertime.serhour_s;
     time = "Server:"+(hours)+":"+(minutes)+":"+(seconds);
    }

```
