XMLSocket onClose event is unreliable

I use XMLSocket in my application and I have connection
management code that automatically reconnects if onClose is called.
However, I've found that often (especially if the connection is
open for a long time) the onClose event isn't called. What causes
onClose to be called? Is there anyway to do one of the following:
- Reconnect in such a way that nothing will happen if I'm
already connected? (Just calling .connect again seems to
disconnect/reconnect me, which is not what I want)
- Check to see if the XMLSocket is connnected?
- More reliably receive onClose events?

Hi David,
Yes, my apologies, I am referring to a dockable panel.  I did see this thread which I thought was referring to a dockable panel as well. 
http://forums.adobe.com/message/6181054#6181054
I’m trying to save to the preferences file when the user closes the panel in CC.  Is this just not possible with a dockable panel?  If not, what do you think is a good work around for saving preferences.
Thanks,
Arie

Similar Messages

  • JavaFX 2.0 Stage onClose event

    There is an event / handler to make some verification to confirm or not a stage close ?
    There is onHiding() but this don´t cancel or block stage close.
    Any idea ?
    Regards,
    Jean Paul Lopes

    Couldn't find a way to keep the primary Stage open, but this is the closest I could get. See the documentation for Platform@runLater, particularly the guarantee that
    The Runnables are executed in the order they are posted. A runnable passed into the runLater method will be executed before any Runnable passed into a subsequent call to runLater.
    import javafx.application.Application;
    import javafx.application.Platform;
    import javafx.event.ActionEvent;
    import javafx.event.EventHandler;
    import javafx.geometry.Pos;
    import javafx.scene.Scene;
    import javafx.scene.control.Button;
    import javafx.scene.control.Label;
    import javafx.scene.layout.FlowPane;
    import javafx.scene.layout.VBox;
    import javafx.stage.Modality;
    import javafx.stage.Stage;
    import javafx.stage.WindowEvent;
    public class ConfirmClose extends Application {
      public static void main(String[] args) {
        Application.launch(args);
      @Override
      public void start(final Stage primaryStage) throws Exception {
        primaryStage.setOnHiding(new EventHandler<WindowEvent>() {
          @Override
          public void handle(WindowEvent event) {
            Platform.runLater(new Runnable() {
              @Override
              public void run() {
                primaryStage.setVisible(true);
            final Stage dialog = new Stage();
            dialog.initModality(Modality.APPLICATION_MODAL);
            Label label = new Label("Really exit?");
            Button okButton = new Button("OK");
            okButton.setOnAction(new EventHandler<ActionEvent>() {
              @Override
              public void handle(ActionEvent event) {
                dialog.hide();
                Platform.runLater(new Runnable() {
                  @Override
                  public void run() {
                    primaryStage.setOnHiding(null);
                    primaryStage.hide();
            Button cancelButton = new Button("Cancel");
            cancelButton.setOnAction(new EventHandler<ActionEvent>() {
              @Override
              public void handle(ActionEvent event) {
                dialog.hide();
            FlowPane pane = new FlowPane(10, 10);
            pane.setAlignment(Pos.CENTER);
            pane.getChildren().addAll(okButton, cancelButton);
            VBox vBox = new VBox(10);
            vBox.setAlignment(Pos.CENTER);
            vBox.getChildren().addAll(label, pane);
            Scene scene1 = new Scene(vBox);
            dialog.setScene(scene1);
            Platform.runLater(new Runnable() {
              @Override
              public void run() {
                dialog.initOwner(primaryStage);
                dialog.setVisible(true);
        primaryStage.setVisible(true);
    }Debugging shows that the Stage is actually hidden when the setOnHiding's EventHandler's handle(...) returns. It also shows that, unlike in Swing, showing a modal dialog doesn't suspend the application thread.
    db

  • Flash Freezes up on frequent calls to XMLSocket.OnXML event handler.

    Hi Everyone,
    I am trying to plot data received in real time on my chumby device which supports actionscript 2. Flash however freezes due to the high data rate of my application. Does anyone know of a way to avoid freezing up the GUI due to the seemingly intensive socket communication?
    Thanks in advance for your help.

    Hello everyone -
    Since I last posted an interesting update happened. I tested my  Flex application again, it is calling a Jetty Server that returns a JSON object, in different BROWSERS.  I disabled HTTPS for now, and the crossdomain.xml policy file is wide open for testing (ie. allowing every request to return data). So the app accessing the data using HTTP only. Browsers  -  IE, Opera, Firefox and Chrome. Each browser contained the SAME application, revision of the Flash Player (10.3.183.10 debugger for firefox, chrome, opera, safari PC; 11.0.1.129 consumer version in IE9,) take a look at the screen shot (safari not shown although the result was the same as IE and chrome)
    Note that Opera and Firefox returned successful values (i.e. successful JSON objects) using the same code generated from the Data Services Wizard. Chrome, IE and, Safari failed with an Internal error. So I am left wondering - WHY? Is it something with the Flash Player? the Browsers?  the Flex SDK? Any thoughts are appreciated. Again, the code is found in the original thread above.

  • [JS/CS4/CS5] Catching a selection event in a ScriptUI interface.

    I've got this ScriptUI interface (javascript based), and now I wonder if it would be possible to change one of its button captions depending on whether anything is selected or not, in the active document (would also have to be updated if the user selects or opens another document).
    1. Is it possible to write event listeners for this?
    2. Would it be possible to include this in the same script as the rest of the Script UI interface code (that is, I'd prefer avoiding a separate file in the startup folder).
    3. What's the best source of information regarding events, which ones there are, and how to handle them in javascript?
    Andreas

    1. Yes. The selection events work well in my experience.
    2. Yes, you don't have to add them at startup. You can do something like:
    app.addEventListener("afterSelectionChanged", selectionChangedFunction);
    before you open your window. Remove the listener in the onClose event of the window. I think you'll have to have some error trapping in the selectionChangedFunction to deal with app.selection erroring after a document close or during a revert.
    3. See this thread for an extension that lets you see events as they're happening.
    Jeff

  • How to detect the HTML extension window close in In-design? Does the In-design throws any event on opening/closing of extensions?

    How to detect the HTML extension window close in In-design? Does the In-design throws any event on opening/closing of extensions?
    I have a HTML extension running in In-design CC 2014 version.
    I want to perform some required set of actions before my extension window is closed(by clicking on the cross button on top right corner).
    Does In-design throws any event for it? Or can we capture it using C++ plugin in some way?

    Naah.......haven't got any event for that yet.
    Although, since HTML extensions are using chromium browser,  as a workaround, u can attach listener to HTML onClose event, but it won't solve any purpose if you
    are looking to logout session or do some business login in your code.

  • How to autoclick/run a button after Alert.Show() Event?

    Hey Guys
    So I have a alert.show happening for something like
    public function test(evt:ResultEvent):void
    if (evt.result.success == "yes")
         mx.controls.Alert.Show("Yay!!!")
    if (evt.result.success == "no")
        mx.controls.Alert.Show("Nay")
    Now I have another button called
    <mx:Button label="Reload" id="Reload" />
    I want that if the sucess == yes scenario is run.. After the popup box comes and a person click OK.. the reload button is run..
    Please tell me how to do so??
    Regards

    You need to set up an event listener on the closeEvent.
    Here is a quick example (untested):
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()">
    <mx:Script>
    <![CDATA[
    import mx.events.CloseEvent;
    import mx.controls.Alert;
    private function init():void {
    Alert.show("myText", "myTitle", Alert.OK | Alert.CANCEL, this, onClose);
    private function onClose(event:CloseEvent):void {
    if (event.detail == Alert.OK) {
    trace("ok pressed");
    } else {
    trace("cancel pressed");
    ]]>
    </mx:Script>
    </mx:Application>

  • How to Connect to TCP Server in AIR?

    I have a TCP server that apparently is working and is listening for incoming connections:
    package
        import flash.display.Sprite;
        import flash.events.EventDispatcher;
        import flash.events.Event;
        import flash.events.*;
        import flash.events.IOErrorEvent;
        import flash.events.ProgressEvent;
        import flash.events.ServerSocketConnectEvent;
        import flash.net.ServerSocket;
        import flash.net.Socket;
        public class TCP extends Sprite
            private var serverSocket:ServerSocket;
            private var clientSockets:Array = new Array();
            public function TCP()
                try
                    // Create the server socket
                    serverSocket = new ServerSocket();
                    // Add the event listener
                    serverSocket.addEventListener( Event.CONNECT, connectHandler );
                    serverSocket.addEventListener( Event.CLOSE, onClose );
                    // Bind to local port 8087
                    serverSocket.bind( 8087, "127.0.0.1" );
                    // Listen for connections
                    serverSocket.listen();
                    trace( "Listening on " + serverSocket.localPort );
                catch(e:SecurityError)
                    trace(e);
            public function connectHandler(event:ServerSocketConnectEvent):void
                //Thesocket is provided by the event object
                var socket:Socket = event.socket as Socket;
                clientSockets.push( socket );
                socket.addEventListener( ProgressEvent.SOCKET_DATA, socketDataHandler);
                socket.addEventListener( Event.CLOSE, onClientClose );
                socket.addEventListener( IOErrorEvent.IO_ERROR, onIOError );
                //Send a connect message
                socket.writeUTFBytes("Connected");
                socket.flush();
                trace( "Sending connect message" );
            public function socketDataHandler(event:ProgressEvent):void
                var socket:Socket = event.target as Socket
                //Read the message from the socket
                var message:String = socket.readUTFBytes( socket.bytesAvailable );
                trace( "Received: " + message);
                // Echo the received message back to the sender
                message = "Echo -- " + message;
                socket.writeUTFBytes( message );
                socket.flush();
                trace( "Sending: " + message );
            private function onClientClose( event:Event ):void
                trace( "Connection to client closed." );
                //Should also remove from clientSockets array...
            private function onIOError( errorEvent:IOErrorEvent ):void
                trace( "IOError: " + errorEvent.text );
            private function onClose( event:Event ):void
                trace( "Server socket closed by OS." );
    But how do I connect to it? I'm trying to make a multiplayer game, and I want variables and strings to be communicated to each client, but what code do I have to put in to get one of the  clients to connect to the other? Again, it successfully LISTENS for a connection, but I don't know how to get anything to connect to it. Another thing is that I get an error thrown at me when I try to test the standalone SWF file, it only listens for connections when I hit "test movie" in the FLA... Thanks in advance...

    Well, i don't know how to detect your ps3 on your imac, but i know a way to connect your PS3 to you imac and Macbook, it's called Remote Play, this was created by sony some years ago, read this article for more: http://www.tech-recipes.com/rx/7225/playstation-3-use-remote-play-on-any-non-son y-vaio-windows-7-pc-ps3-firmware-3-30/

  • Best way to manage an "Esc" pressed by the user

    Hi friends
    I normally create dialogs to offer options to the user before executing the script functions. So, having a "Cancel" button in this dialog would suit the need for an user to cancel the operation.
    But let´s say the user selected the options in the dialog and pressed button OK to start the execution of the process. The dialog will close and process will start. Suppose it will take 1 minute to complete.
    If, inside this 1 minute, the user presses "Esc" key in keyboard, then the execution will stop, but it will display an alert (like an an error) it was not possible to finish the process (sure, he cancelled the operation).
    What I want to understand: Is it possible to manage this "cancellation" of the user via the ESC and do not display alerts? For example, write a function that tells...If user presses "ESC", then abort the process and display no dialog.
    Would an event listener that reads the keydown "ESC" would be suitable for this task? or is there any simpler or suitable way to do it?
    Thank you very much for the tips.
    Gustavo.

    I don't think it is possible with javascript. I don't know about other languages.
    Because the esc key also can be used to close a dialog, while the dialog is open you can write an onClose event handler to try to add clean up code. It should work if the user only presses the esc key once. But if they press more than once or hold down the esc key the script will stop before the handler is done. In other words the first press closes the dialog( running the onClose event ) and the second press stops the script. Even a keyboard event handler inside the dialog of the esc key can't keep repeated presses from stopping the script. At least I have not found a way and I spent a good bit of time trying.
    Once the dialog is closed or if the script doesn't use a dialog the first esc key press stops the script. There isn't an event for esc that can be used by the scripts event manager or app.notifiers. But even if there were I think it would have the same behavior as the dialog onClose.
    I can understand why esc stops the script regardless of what the script wants to do. After all the esc key is the user's 'panic button' when they think something is wrong. I am not sure having a way to ingore a user's request to 'stop now' is a good thing.

  • Acrobat Reader Versions and saveAs, exportXFAdata Problems

    We use generate Forms with Reader Extension Save enabled.
    The forms are then opened within Acrobat Reader. In the onClose Event a Script called "saveXMLData" is called. This script is install in the javascript folder of the reader installation.
    The script :
    var saveXMLData = app.trustedFunction(function(doc)
         app.beginPriv();
         doc.saveAs({cPath:"/c/windows/temp/savedForm.pdf",
              bCopy: true,
              bPromptToOverwrite: false });
         doc.exportXFAData({
              cPath:"/c/windows/temp/savedForm.xml",
              bXDP:false
         app.endPriv();
         return;
    Using Acrobat Reader 7, eveything worked fine.
    Using Acrobat Reader 9 "saveAs" crashes the Application after the document is saved and the filled in Data is not saved.
    Without the saveAs function, at least the export File is generate but the data that where filled in are missing.
    Using Acrobat Reader X "saveAs" crashes the Application as well. Leavin out the saveAs function, the export File is generated as expected. Thus the filled in data values are saved.
    Using Acrobat X Pro everything works as with Acrobat Reader 7.
    Our Problem is that the customer uses Acrobat Reader 9. Are there expected incompatibilities with the different versions. Does anybody know any workarounds, settings?
    By the way disabling extended security does not help.
    Thanks
    Max

    It cannot be a problem of the installation, because at least Windows 7
    was a fresh install with nothing but Reader additionally installed.
    By the way, what do you mean by "risky", I followed straight the
    documentation from Adobe, where one is allowed to place function calls
    requiring a privileged context.
    Have you any better idea where to place the call to save? It must be
    called automatically, when the User closes the window, no additional
    interaction is possible.
    One other thing is the call to exportXFAData, have you any idea why
    there is a difference in behavior between reader version 7 / 10 and 9?
    I wrote that in version 9 the user entered data is missing.
    Am Donnerstag, den 21.07.2011, 05:53 -0600 schrieb try67:
    No, it doesn't work.
    Sorry, I don't have any ideas except for trying to repair the installation
    of Reader.
    However, placing code in the WillClose event is considered risky and should
    be avoided if there are alternatives available.
    >

  • Parent child window functionality using CFM

    In .cfm page I am trying to implement the following
    functionality
    I got a parent window contains a button.
    On button click a child window should get open.
    This child Window should get embed in that parent window
    (like MDI application)
    1)i.e While minimizing the parent window this child window
    should also get minimized
    2)While closing the parent window this child window should
    also get closed
    3) We should also be able to close the child window alone.
    4) If you double click on the title bar of the child window
    it should get maximized
    5) Again double click on the title bar of the child window it
    should get minimized.
    I tried with <embed> tag but it seems its for audio ,
    flash kind files.
    If we can use <embed> tag means whats should be the
    value of the "Type" attribute.
    waiting for your valuable information

    Window handlers and controls are generally a function of the
    browser and not really manipulatable using ColdFusion, as it runs
    on server-side only, not client-side. JavaScript would be more the
    thing to play with in this regard, although I don't think there is
    an "onClose" event handler.
    HOWEVER!
    All browsers have a security feature that prevents pop-up
    child windows from "hijacking" their parents window behaviors,
    including resizing, moving, changing the toolbars, closing, etc.
    This security feature cannot be bypassed, and is an integral
    hard-coded aspect of all modern browsers. I suspect that what you
    are looking to do may be impossible due to this one fact, unless
    someone knows a bypass.

  • How to use table popin?

    Hi Experts,
    i want to usse table popin in one of my ui table element.
    i have just starte webdynpro ABAP.
    So if any one has steps for this problem.
    plz help me.
    Regards,
    Susheel K Joshi

    Follow these steps:
    1. Create an attribute 'Selected_Popin'  type string in your node bound to the table control.
    2. Goto the layout. Select the column and right click to Insert a table popin in the column
    3. Create a transaprent container under that and design the popin as per your requirement
    4. Create OnAction method for the table column and write the following code
    " create a importing parameter CONTEXT_ELEMENT type if_wd_Context_element
           context->element->set_attribute( exporting name = 'SELECTED_POPIN'  " attribute that we create above
                                    value  = 'TABLE_POPIN ' ) . " id of your table popin
    5. Create OnClose event for the Popin and write the following code.
    " create a importing parameter CONTEXT_ELEMENT type if_wd_Context_element
         context->element->set_attribute( exporting name = 'SELECTED_POPIN'  " attribute that we create above
                                     value  = '  ' ) . " space
    Hope this helps !
    Regards,
    Radhika.

  • Flex and Linux help

    I have some socket code that works fine in Windows and Mac.
    However, the socket
    wont connect or
    throw an error in the Linux flash player (debug or normal).
    Below is a code fragment. I can't find any reference to any special
    circumstances for Linux. If I am doing something wrong, then some
    help would be greatly appreciated.
    import flash.net.Socket;
    import flash.events.IOErrorEvent;
    import flash.events.SecurityErrorEvent;
    import flash.system.Security;
    private var socket: Socket = new Socket();
    public function connectToLogger( ipAddress: String = null,
    ipPort: int = 8000): void
    // event for when the server connection is established.
    socket.addEventListener( Event.CONNECT, onConnect );
    // event for when the server closes the socket.
    socket.addEventListener( Event.CLOSE, onClose );
    // event for when there is an I/O error event logged during
    connection.
    socket.addEventListener( IOErrorEvent.IO_ERROR, onIOError );
    // event for when there is an security error event logged
    during connection.
    socket.addEventListener( SecurityErrorEvent.SECURITY_ERROR,
    onSecurityError );
    // Listen for when data is received from the socket server
    socket.addEventListener( ProgressEvent.SOCKET_DATA,
    onSocketData );
    try
    trace( "Trying to connect (" + ipAddress + ": " + ipPort +
    socket.connect( ipAddress, ipPort );
    catch( error: SecurityError )
    trace( "socket.connect error" + error );
    catch( error: IOError )
    trace( "socket.connect error" + error );
    trace( "socket.connected = " + socket.connected );

    Turns out it was a bug in the Flash player. The beta player
    released on 21st of August 2007 successfully connects from
    Linux.

  • Closing POP-UP fails

    Hi experts,
    I have an issue to close cascading pop-up.
    I am displaying a first pop-up to user so he can choose fields for marketing target group extraction to file. Once the user had chosen the relevant fields, he can click on a "Save variant" button on the pop-up that launches another pop-up to set name of the "variant" and description. Then he has to click a save button that closes the pop-up, retrieves the name and the description through the context node and closes the pop-up. Then the onclose event triggered for last mentioned pop-up saves the mapping using standard functions and the first mentioned pop-up has to be closed (using standard outbound plug for window : "leave"), but unfortunately it does not. I get then a strange behavior with the first pop-up that is not closed. To close it in the right way (without clicking the cross), user have to choose another field in the pop-up that displays the fields available for variant and click on a button cancel that trigger the standard window outbound plug for window : "leave" and the first pop-up is finally close.
    Thanks for your help !
    Antoine

    Dear Ashwinee,
    To close a pop-up you have to :
    - Create the outbound plug "OP_LEAVE" in the window controller of the pop-up you want to close with following coding : me->fire_outbound_plug( iv_outbound_plug = 'leave' ).
    - Then you have to call this outbound plug in the event that must trigger the pop-up closing using following coding in view controller:
      DATA lr_window TYPE REF TO cl_bsp_wd_window.
      lr_window = me->view_manager->get_window_controller( ).
      lr_window->call_outbound_plug( 'LEAVE' ).
    Rewards if it helps.
    Regards,

  • Simple Socket Question / Error...

    I'm testing out a socket connection for an RDP app on the playbook.
    Flash Builder Burrito 4.5
    Adobe AIR SDK 2.5 Hero
    Playbook SDK 0.9.2
    Playbook Sim 0.9.2
    VMPlayer running in Bridged Networking mode
    public function RDPApp()
                   var socket:Socket = new Socket();
                   socket.addEventListener(Event.CONNECT, onConnect);
                   socket.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
                   socket.addEventListener(Event.CLOSE, onClose);
                   socket.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);
                   socket.addEventListener(ProgressEvent.SOCKET_DATA, onReceivedData);
                   socket.connect("http://www.google.com", 80);
                   socket.close();
                   stage.nativeWindow.visible = true;
              private function closeWindow(event:MouseEvent):void{
                   stage.nativeWindow.close();
              protected function onConnect(event:Event):void
                   // TODO Auto-generated method stub
              protected function onIOError(event:IOErrorEvent):void
                   trace(event);
              protected function onClose(event:Event):void
                   // TODO Auto-generated method stub
              protected function onSecurityError(event:SecurityErrorEvent):void
                   // TODO Auto-generated method stub
              protected function onReceivedData(event:ProgressEvent):void
                   // TODO Auto-generated method stub
    The code above throws on the sim and on the desktop:
    IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2031: Socket Error. URL:http://www.google.com" errorID=2031]
    Googling this error message indicates that the client flash app has not received the required policy file from the server.
    I was under the impression that AIR apps running on the desktop sandbox (Playbook included) do not require the retrieval of the policy file.
    Any help is much appreciated.
    Matt

    For sockets you need to first load the securitypolicy file then call methods on it.
    ref : http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/Socket.html
    Message was edited by: saisri2k2

  • How to Make Multiplayer TCP Flash Game?

    I have a game in the works, and though I got the UDP to work perfectly, I sadly later found out that that is simply just a lossy protocol. There's apparently (as far as my knowledge goes) nothing you can do to make it resend data if the data was not received successfully by the recipient.
    So, I was wondering how to use TCP? I've heard it's possible, but I can't seem to find a single tutorial or any information anywhere on how to do it. I found on Adobe's site socket connections, and though I got the server to connect (I think), I have no clue how to send data to it, how to get other clients to connect to it, etc. Any help?
    This is the script I've been using, and though it does connect... that's basically all it does, I don't know where to go from here...
    package
        import flash.display.Sprite;
        import flash.events.EventDispatcher;
        import flash.events.Event;
        import flash.events.*;
        import flash.events.IOErrorEvent;
        import flash.events.ProgressEvent;
        import flash.events.ServerSocketConnectEvent;
        import flash.net.ServerSocket;
        import flash.net.Socket;
        public class TCP extends Sprite
            private var serverSocket:ServerSocket;
            private var clientSockets:Array = new Array();
            public function TCP()
                try
                    // Create the server socket
                    serverSocket = new ServerSocket();
                    // Add the event listener
                    serverSocket.addEventListener( Event.CONNECT, connectHandler );
                    serverSocket.addEventListener( Event.CLOSE, onClose );
                    // Bind to local port 8087
                    serverSocket.bind( 8087, "127.0.0.1" );
                    // Listen for connections
                    serverSocket.listen();
                    trace( "Listening on " + serverSocket.localPort );
                catch(e:SecurityError)
                    trace(e);
            public function connectHandler(event:ServerSocketConnectEvent):void
                //Thesocket is provided by the event object
                var socket:Socket = event.socket as Socket;
                clientSockets.push( socket );
                socket.addEventListener( ProgressEvent.SOCKET_DATA, socketDataHandler);
                socket.addEventListener( Event.CLOSE, onClientClose );
                socket.addEventListener( IOErrorEvent.IO_ERROR, onIOError );
                //Send a connect message
                socket.writeUTFBytes("Connected");
                socket.flush();
                trace( "Sending connect message" );
            public function socketDataHandler(event:ProgressEvent):void
                var socket:Socket = event.target as Socket
                //Read the message from the socket
                var message:String = socket.readUTFBytes( socket.bytesAvailable );
                trace( "Received: " + message);
                // Echo the received message back to the sender
                message = "Echo -- " + message;
                socket.writeUTFBytes( message );
                socket.flush();
                trace( "Sending: " + message );
            private function onClientClose( event:Event ):void
                trace( "Connection to client closed." );
                //Should also remove from clientSockets array...
            private function onIOError( errorEvent:IOErrorEvent ):void
                trace( "IOError: " + errorEvent.text );
            private function onClose( event:Event ):void
                trace( "Server socket closed by OS." );

    again:  unless you're using a server that all players connect to, you should be using adobe's peer-to-peer networking (rtmfp).
    ie, with multiplayer each player can communicate with a server and the server communicates with each player, or you use peer-to-peer communication.  below is an excerpt from a book i wrote (Flash Game Development: In a Social, Mobile and 3D World).
    Social Gaming - Multiplayer Games
    With multiplayer games, data needs to be communicated among the players.  When a player makes a move (changing the game state) the updated game state needs to be communicated to all the other players. In addition, that communication needs to occur in a timely manner. 
    With turn-based games (like card games) that communication among players can take as long as few seconds without degrading the game experience. With real time games (like shooter games), even a 250 millisecond delay in communicating game state leads to a significantly degraded player experience. Consequently, real time multiplayer games require substantial expertise to successfully develop and deploy.
    There are two fundamentally different ways that communication among players can be accomplished. Players can communicate via a server (server-based games) or they can communicate directly from player to player (peer-to-peer) games.
    Server Based Multiplayer Games
    Generally, the code in each player’s Flash game handles the player’s input, transmits player data to the server, receives other players' data and displays the game state. The server receives player data, validates the data, updates and maintains game state and transmits each player’s data to the other players.
    The code used on the server cannot be ActionScript so you will need to learn a server-side coding language like php or c#.  Server-side coding is beyond the scope of this book so I will not cover server-based multiplayer games except to say you need to have advanced coding skills in, at least, two languages (ActionScript and a server-side language) to create these game types.
    Peer-to-peer games
    Since Flash Player 10, you can create multiplayer games without the need of an intermediary server to facilitate player communication.  The Flash Player can use a protocol (Adobe's Real-Time Media Flow Protocol) that allows direct peer-to-peer communication.
    Instead of using server-side code to handle the game logic and coordinate game state among players, each peer in the network handles their own game logic and game state and communicates that directly to their peers and each peer updates their game state based on the data received from others.
    To use peer-to-peer networking each peer must connect with an Adobe server.  Peer-to-peer communication does not go through that server (or it that would not be peer-to-peer) but peers must stay connected with the Adobe server in order to communicate with each other.
    To communicate with the Adobe server you should use your own server URL and developer key. That URL and key can be obtained at http://www.adobe.com/cfusion/entitlement/index.cfm?e=cirrus.
    Below is a simple tic-tac-toe game that uses Adobe's peer-to-peer networking to pair-up players.  The NetConnection class is used to establish a connection to the Adobe server while the NetGroup class is used for peer-to-peer communication.
    I used only a small part of the NetGroup methods for the tic-tac-toe game but there are more available if you are sharing data among many users and/or sharing large amounts of data.
    The tic-tac-toe game is in support files/Chapter 11/multiplayer and is extensively commented

Maybe you are looking for

  • Customise Theme Images

    10 Duke Points Is it possible to use custom images on the components. For example: how can we replace the expand and collapse icons (not the icon against the node) on the Tree component to a different icon from that provided on in the Theme. Some for

  • There was a problem downloading podcast

    If I get the error "The URL xxx could not be found on the server", how do I notify the iTunes store to remove the podcast? Doesn't the iTunes store automatically get notified when this happens?

  • Syntax issue when having more than 20 warnings

    Hello, when having more than 20 warnings in a compilation unit (package, procedure ...), SQL Developer ( version 1.5.0.53) doesn't always flag an error (like, for example, a misspelled local variable), so instead of a compile-time error a runtime err

  • BDC Related Upgrade issues

    Hi every one, I want to know wat are the issues while doing a version upgrade. I have the knowledge of Dynpro missing , Screen Field related problem and Program itself missing the target system. Pls .. tell me .some other issues... Thanks Everyone in

  • Trying to use migration assistant , it has been at one minute to go for the las 5 hours what do I do

    I am using migration assistant and it is at one minute remaining for the last 5 hours, what do I do?