1 Reply Latest reply on Jan 10, 2011 6:35 AM by kglad

    Cannot get the Clock working.

    Ron Colmen Level 2

      I can't get this analog clock working using time returned by the php.

       

      server = new LoadVars();

      server.onData = function (src){

      counter.onEnterFrame = countdown;

      counter._visible = true;

      this.time = Number(src);

      };

      server.load("http://www.webme.com/time.php");

      counter._visible = false;

       

      countdown = function(){

      this.msecs = server.time;

       

      var secs = Math.floor(this.msecs);

      var mins = Math.floor(this.secs/60);

      var hours = Math.floor(this.mins/60);

       

      root._counter.hours_mc._rotation = (hours*30) + (mins/2);

      root._counter.minutes_mc._rotation = 6 * mins;

      root._counter.seconds_mc._rotation = 6 * secs;

      }

       

      php

      $tz =  new DateTimeZone('Africa/Conakry');

      $date = new DateTime('now', $tz);

      echo "time=" . strtotime($date->format('Y-m-d H:i:s'));

       

      Thanks and Happy New Year!!