FlexTip: XMLSocket connect() after disconnect from server

Tuesday, July 24th, 2007
FlexTip: 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.

AddThis Feed Button

This is some text prior to the author information. You can change this text from the admin section of WP-Gravatar  I'm living in Bratislava, Slovakia. I'm Senior Flex, AIR Developer for my own company Flexets. Read more from this author


tagged under: .

ABOUT THIS AUTHOR

I'm living in Bratislava, Slovakia. I'm Senior Flex, AIR Developer for my own company Flexets.

Get a Trackback link

3 Comments


  1. barry.b
    Visit Site
    July 24th, 2007

    “It seems it must be called on next frame. ”

    Frame? you’ve thrown me there. I don’t come to Flex with a Flash background. I actually don’t think in Frames for Flex at all even though I know the final outcome is a swf.

    how do I know when the “next frame” is to make the call? if I use callLater(), that should automatically kick in when it’s ready, yes?

    many thanks


  2. Administrator
    Visit Site
    July 24th, 2007

    Ok, you’re right, there are no frames. I call it “frame” because of good old flash, but you’re right, it means when it is ready.

    callLater() works, we have it in our project, and it works


  3. adg
    Visit Site
    January 22nd, 2008

    do you now if it is perfectly possible to have a flex app in a browser that works with a server that goes down from time to time?
    (supposing you can code your client app so that it takes care of it)

    do you need to use xmlsockets?
    does it work with flex/livecycle data services:
    thus do the remoteobject, dataservice,… things also work?

    adg

Live Preview

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="">

This site is using OpenAvatar based on
Images is enhanced with WordPress Lightbox JS by Zeo
Clicky Web Analytics