title: AS3 timer is faster than php
body: <p>Im trying too load new messages every second, but new messages are doubled everytime they are loaded, I suppose because the timer is completed before the php is executed?
  so I tried to add </p>
  
  <pre><code>  if (checker != "" + idstored + "done") {
  checker =  "" + idstored + "done";
  </code></pre>
  
  <p>so that once the timer completes, it changes the checker so that when the timer restarts and finishes again it would not execute again... but it stopped checking for all new messages... any tips??</p>
  
  <pre><code>var count:Timer = new Timer(1000, 1);
  count.addEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete); 
  count.start();
  
  var checker;
  function onTimerComplete(event:TimerEvent):void{
      if (checker != "" + idstored + "done") {
      checker =  "" + idstored + "done";
  
      var variables_cc:URLVariables = new URLVariables();
      var varSend_cc:URLRequest = new URLRequest("chat.php");
      varSend_cc.method = URLRequestMethod.POST;
      varSend_cc.data = variables_cc;
      var varLoader_cc:URLLoader = new URLLoader;
      varLoader_cc.dataFormat = URLLoaderDataFormat.VARIABLES;
      varLoader_cc.addEventListener(Event.COMPLETE, completeHandler_cc);
  
      function completeHandler_cc(event:Event):void{
          if (event.target.data.statusline == "is_new") {
                stored_id_txt.text = "" + event.target.data.stored_id;
                status_txt.text = "" + event.target.data.statusline;
                returnline.text = "" + event.target.data.returnBody;
                checker.text = checker;
                splitByDelimiter(event.target.data.returnBody);
                idstored = event.target.data.stored_id;
                checker = "refresh";
          } 
      }}
      // ready the last_refresh_time variable for sending to PHP
      variables_cc.requester = "chat_check";
      variables_cc.stored_id = idstored;
      varLoader_cc.load(varSend_cc);
      count.reset();
      count.start();
  }
  </code></pre>