First time when you read the buffer is consumed.
Comment the trace and it should work.

C



________________________________
From: markflex2007 <markflex2...@yahoo.com>
To: flexcoders@yahoogroups.com
Sent: Tuesday, October 25, 2011 6:39 PM
Subject: [flexcoders] pass String with socket


  

Hi,

I pass string with socket in Flex

I can see the data with
trace(socket.readUTF());

but I can not do (otherwise I get #2030 error)
var s:String= socket.readUTF();

I try to do 
var s:String=socket.readUTFBytes(socket.bytesAvailable);

but socket.bytesAvailable = 0 why? I can see a string with 
trace(socket.readUTF());

how to save the socket data to a string variable?

Thanks

Mark


 

Reply via email to