Serial Proxy and Flash

I, i need your help on this.

I have flash and arduido with serial proxy, but,

I send a command to arduido like ( ID + chr(13)), and i have to receive ( ID TH-F7 )

But the flash only receive the data send by arduido, when i sent another command to arduido.

I connect the hiper-terminal using TCP/IP (Winsock) with the IP and port number and disconnect the flash, and all working fine...
with hiper-terminal i send and receive all commands with no problem.

The code in flash,
system.useCodepage = true;

hms = "";
ip = "192.168.2.2";
porta = 5001;
lig.htmlText += ""+hms+"--> Remote IP: "+ip;
lig.htmlText += ""+hms+"--> Porta: "+porta;
invia.htmlText = ""+hms+"-->Weelcome!!!
";

mySocket = new XMLSocket();
mySocket.connect(ip, porta);
mySocket.onConnect = function(success){
if (success)lig.htmlText += ""+hms+"-->Server connection established!";
else lig.htmlText += ""+hms+"-->Server connection failed!"; };

mySocket.onClose = function(){
lig.htmlText += ""+hms+"-->Server connection lost"
};

XMLSocket.prototype.onData = function(msg) {
recebe.htmlText += msg;
};

//--- Handle button click --------------------------------------
function sendMsg(){

mySocket.send(inputMsg.text+ chr(13) );
invia.htmlText += hmsm+" "+inputMsg.text;

}

this.onData = function (data) {
trace ("incomingg " + data);
trace ("incoming " + data.text);
inputer.text = inputer.text + data;
};

envia.onRelease = function() {
sendMsg();
}

id.onRelease = function() {
mySocket.send("ID" + chr(13));
invia.htmlText += "IdentificaĆ§Ć£o";

}

I have all so tried with others serial proxys and the problem is the same.

The problem is in the flash, but were???

What i need is when i receive a chr(13) in the proxy, the proxy send me the data to flash.
I have all so read all docs and forums but dont find the error...

Tanks for the help!!!

Lagarto Oliveira from Portugal