2、ic class SocketExample extends Sprite { 7. 8. private var socket:Socket; 9. 10. public function SocketExample( ) { 11. socket = new Socket( ); 12. 13. // Add an event listener to be notified when the connection 14. // is made 15. socke
3、t.addEventListener( Event.CONNECT, onConnect ); 16. 17. // Listen for when data is received from the socket server 18. socket.addEventListener( ProgressEvent.SOCKET_DATA, onSocketData ); 19. 1. //var btnSend:Button = new Button(); 2. btnSend.labe