3 Replies Latest reply on Sep 22, 2009 10:46 PM by berno84

    Problem with XMLSocket

    berno84

      Hi all. I have a problem with XMLSocket. I'm unable to use connect and send functions, flex show's errors:

       

      1061: Call to a possibly undefined method connect through a reference with static type XMLSocket.

      1061: Call to a possibly undefined method send through a reference with static type XMLSocket.

       

      Here is  the code (it's example from doc. pages)

       

                 import flash.net.XMLSocket;
             
                  private var xmlsock:XMLSocket;
                  private function init():void{
                      xmlsock = new XMLSocket();
                      xmlsock.connect("127.0.0.1", 8080); // here gives error
                      xmlsock.addEventListener(DataEvent.DATA, onData);
                  }
                 
                  private function onData(event:DataEvent):void{
                      trace("[" + event.type + "] " + event.data);
                  }
                 
                  private function sendString():void{
                      var xmlFormattedData:XML=new XML();
                      xmlsock.send(xmlFormattedData); // here gives error
                  }

       

      I'm using flex builder 3 for linux. Is there a workaround for this?