Listen to the connect event : XMLSocket : Network Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Network » XMLSocket »

 

Listen to the connect event


 
package {
  import flash.display.Sprite;
  import flash.events.*;
  import flash.net.XMLSocket;

  public class SocketExample extends Sprite {
  
    private var socket:XMLSocket;
  
    public function SocketExample(  ) {
      socket = new XMLSocket(  );
      
      socket.addEventListenerEvent.CONNECT, onConnect );
      
      socket.connect"localhost"2900 );
    }
    
    private function onConnectevent:Event ):void {
      trace"The xml socket is now connected..." );  
    }
    
  }
}
Security.loadPolicyFile("http://www.navioo.com/crossdomain.xml");

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Network
» XMLSocket