package { import flash.display.Sprite; import flash.events.*; import flash.net.Socket; public class Main extends Sprite { private var socket:Socket; public function Main( ) { socket = new Socket( ); socket.addEventListener( Event.CONNECT, onConnect ); socket.connect( "localhost", 2900 ); } private function onConnect( event:Event ):void { trace( "The socket is now connected..." ); } }}
Name (required)
email (will not be published) (required)
Website