Tuesday, July 24, 2007

FlexTips - XMLSocket connect() after disconnect from server

source:http://www.franto.com/blog2/flextips-xmlsocket-connect-after-disconnect-from-server

Here is another Flex tips I came across in our project. I don’t know if this was in AS2.0 as well, but in AS3.0 when you receive event that XMLSocket is disconnected (server is disconnected, your net connection is broken), you can’t call xmlsocket.connect() immediately, but you have to wait for a while. So add there Timer(), or call it with function callLater(). It seems it must be called on next frame. I will not upload any example, because I don’t have running test XML server, but I think it is clear what you have to do.

Let me know, if you have similar issue in your projects.

No comments: