0 Replies Latest reply on Dec 2, 2009 9:49 PM by kensuk1

    XMLSocket Problem

    kensuk1

      I can work fine which run in flash . I can see the connection can established and disconnected until i close the flash

       

      but i publish the flash to html and run in broswer, the flash can connect to server but it will disconnected in the same time. That means i can see the log is established connection then disconnect connnection.

       

      I cannot find the solution.

      Please help.

       

      Thank you

       

      flash code :

      mySocket = new XMLSocket();
      mySocket.onConnect = function(success) {
          if (success) {
              msgArea.htmlText += "<b>Server connection established!</b>";
          } else {
              msgArea.htmlText += "<b>Server connection failed!</b>";
          }
      };

       

      mySocket.onClose = function() {
          msgArea.htmlText += "<b>Server connection lost</b>";
      };
      XMLSocket.prototype.onData = function(msg) {
          msgArea.htmlText += msg;
      };
      mySocket.connect("dyn.obi-graphics.com", 9999);
      //--- Handle button click --------------------------------------
      function msgGO() {
          if (inputMsg.htmlText != "") {
              mySocket.send(inputMsg.htmlText+"\n");
              inputMsg.htmlText = "";
          }
      }

       

      pushMsg.onRelease = function() {
          msgGO();
      };