Skip to main content
Participating Frequently
July 14, 2006
Question

Closing connection of one user..

  • July 14, 2006
  • 1 reply
  • 181 views
now i'm busy with this sharedball thing, so each one that connects gets his own ball.. (with attach function)
but now i want do de-attach when someone leaves. this someone might not be interested in clicking logout... (or disconnect) and he will click the window right away..

the ball will remain on screen ofcourse. now i want it to be de-attached when someone closes the (IE) window. I think this could be done by javascript but not everyone has javascript on, so thats not a good choise. Perhaps it could be done by some inside code in the SWF..

any help would be appreciated
    This topic has been closed for replies.

    1 reply

    July 14, 2006
    There are a few ways this can be done, but all of them require that you start identifying your clients one way or another.

    The simplest way to do this is to set up a shared object with properties for each user, and have the clients respond to changes to those properties.

    If you have the PFCS book, there's a chapter with a chat component (chapter 15 I believe) that illustates this quite well There are samples on the website (flash-communications.net). When a client joins the chat, a property is added to the SO, and the client side component adds the UI elements and handles the stream connections for the user. When the client leaves the room, the property in the SO is removed, and the clients respond accordingly.

    So, yes, you'll add some code to the .swf, but you'll also add some code to your SSAS.