Alexander Farber wrote: > I've come up with this, but still have a flaw there: > > private function handleTcpData(event:Event):void { > var len:uint;
what about this simple alternative: private function handleTcpData(event:Event):void { if(_socket.bytesAvailable) { try{ var str:String = _socket.readUTF(); updateGUI(str); }catch(e:Error){} } } I havn't tested, but if the socket class is well designed, the buffer should only be flushed if readUTF() was sucessful, and therefor the above code should work fine. cheers, valentin _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders