views:

163

answers:

1

I have a program made with flash/ac3 that connects with a java server. Using the following code:

socket.addEventListener(ProgressEvent.SOCKET_DATA, onReceive);

The socket receives messages just fine, however, when I start to send a lot of messages after each other things go wrong. Even when I only print the message I receive at least 50% of the messages are not printed. So when I send 20 messages, containing the message 1 to 20, flash will only print:

1 3 8 11 15 20

Is this because the socket is still busy doing something while the next message is already arriving? Or could my code be somehow wrong? What is a good way to solve this?

A: 

I'm taking a guess that when you say "print" you mean that you are updating some text field or label and that perhaps are queueing the GUI update with CallLater. I did something similar using a label to store state rather than only display it with similar symptom. Also, updating the 'text' member field of a label seems to be immediate although other seemingly related fields such as Length are delayed in their updates.

Good luck.

JCG