3 Replies Latest reply on Sep 26, 2006 3:19 AM by Peter Lorent

    analog clock

      I have coe to greate an analog clock in flash:
      onClipEvent ( enterFrame ) {
      var time = new Date();
      var hours = time.getHours();
      var minutes = time.getMinutes();
      var seconds = time.getSeconds();
      this.hour._rotation = this.hour_shadow._rotation = 30 * hours + minutes / 2;
      this.min._rotation = this.min_shadow._rotation = 6 * minutes;
      this.sec._rotation = this.sec_shadow._rotation = 6 * seconds;

      but this just echoes the time on whomever's computer
      I would like to create four showing the time in CA, NY , China, and London.
      Any ideas? I stink at programming so please be verrrrry specific.
        • 1. Re: analog clock
          Peter Lorent Level 2
          >>I stink at programming so please be verrrrry specific.
          Man, you got me laughing. I nearly choked.

          Well, as you say, this is great but not what you are looking for. To get a reliable time you have to use server side software to get the time from your server (if the time there is correct) or create/use a webservice. Once you have a correct time you can do some math to calculate the time differences (and if using an exisiting webservice you wouldn't have to do the math because I think that's not one of your favorite topics...
          • 2. Re: analog clock
            Yael_K Level 1
            let's say I use php, for example. what would the code be like? I'm still confused
            • 3. Re: analog clock
              Peter Lorent Level 2
              You can find everything you need on php.net and for tutorials you can check out phpfreaks.com or google 'php date'. For a tutorial on webservices look in www.adobe.com/devnet/flash under data integration