4 Replies Latest reply on Jul 19, 2010 6:23 AM by rootsounds

    HTTPService caching in Internet Explorer

    gth759k

      My app is working fine in Firefox, but not IE! I've tried adding a unique timestamp to the URL, but it still isn't updating in IE! Any suggestions?

      Here's my code ...

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" horizontalAlign="center" verticalAlign="center" backgroundAlpha="0.0" creationComplete="init();">
         
          <mx:Script>
              <![CDATA[
                     private var timer:Timer;
                     
                     public function init():void {
                          userRequest.send();
                          
                          timer = new Timer(1000);
                          timer.addEventListener(TimerEvent.TIMER, updateInterface);
                          timer.start();
                     }
                     
                  private function updateInterface(evt:TimerEvent):void {
                          userRequest.send();
                  }
                     
                  import mx.utils.UIDUtil;
      
                  private function generateUID():String {
                      return UIDUtil.createUID();
                  }
                     
                     private var dNoCache:Date = new Date(); 
                     private var uniqueTime:String = dNoCache.getTime().toString(); 
                     
                     [Bindable]
                     private var connectUrl:String = "http://localhost/meesh/connect.php?friend=greenarrow&time="+uniqueTime;
              ]]>
          </mx:Script>
           
           <mx:HTTPService id="userRequest" url="{connectUrl}" useProxy="false" method="GET" resultFormat="text" result="conversation.htmlText = event.result.toString();"/>
           
          <mx:Panel id="controlpanel" title="" width="100%" height="100%">
                <mx:TextArea id="conversation" width="100%" height="100%">
                     <mx:htmlText></mx:htmlText> 
                </mx:TextArea>
          </mx:Panel>
         
      </mx:Application>