Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2014
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. public function socketConnect(e:Event) {
  2. // We have connected successfully!
  3. trace('Connected to the server!');
  4.  
  5. // Hook the data connection
  6. //sock.addEventListener(ProgressEvent.SOCKET_DATA, socketData);
  7. var buff:ByteArray = new ByteArray();
  8. writeString(buff, json + '\r');
  9. sock.writeBytes(buff, 0, buff.length);
  10. sock.flush();
  11. }
  12. private static function writeString(buff:ByteArray, write:String){
  13. trace("Message: "+write);
  14. trace("Length: "+write.length);
  15. buff.writeUTF(write);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement