onDisconnect not working as expected on IE7

Ask a Question related to Macromedia Flash Flashcom, Design and Development.

  1. #1

    Default onDisconnect not working as expected on IE7

    I have an application for a poker game which works perfectly in Firefox 1.5 and
    2.0, however in IE7 (not too sure about IE6 thou) there is a serious problem. I
    shall explain..

    User logs in. Opens a popup of the game which is just a php script which loads
    in the SWF. SWF successfully connects the the FCS 1.5 and sits around waiting
    for another player... however at any time if the person closes the window or
    and any other IE7 windows are open the "onDisconnect" rule on the server side
    does not execute, therefore since this game only allows you to play one game at
    any one time, if you try to open a window to start a new game it finds an
    existing instance of the player.

    Only if *all* IE7 windows are closed does the onDisconnect finally recognise
    that the person has disconnected.

    This is only happening in IE, wherehas FIrefox, Safari and Konq. all work as
    expected.

    The browser flash plugin is version 9 on all the machines.

    Anyone had or experience similar problems with the onDisconnect, and more
    importantly.. is there a fix? This is really urgent since this game should have
    gone out a while ago, and really just this problem is causing a hold-up.

    If it helps, please check out the problem on [url]http://www.pokerwars.com[/url], login,
    open a game, close the popup window and re-open a new game... this is driving
    me *nuts*

    Many thanks

    Wyldie Guest

  2. Similar Questions and Discussions

    1. setStyle() not working as expected
      Hello, I have a need when a mouse pointer hovers over a vbox container, the backgroundColor property should be changed to a gray color and when...
    2. getURL() not working as expected
      Hello, We have a requirement where homepage of the site will be specific to a country. When a first time user navigates to the site(say,...
    3. CFLOOP not working for record insert as expected
      Have you tried <cfdumping the queries to make sure they contain what you expect?
    4. Export as graphic not working as expected....
      Okay, I'm using Illustrator 11 (CS) to export a file as a JPEG (or often times as PNG). It's sending all the contents on the pasteboard as well,...
    5. base ="." attribute not working as expected
      Hi, I am trying to construct a site and implement the <base = "."> attribute in the object and embed tags of the flash navigation, but it is not...
  3. #2

    Default Re: onDisconnect not working as expected on IE7

    I've found there are a number of situations where the onDisconnect never gets
    fired off. In your case, I"m wondering if you're using SWFObject, or more
    specifically, and outdated version of SWFObject. I read that previous versions
    created such problems with netconnections.

    You'll also find that disconnecting the client machine from it's network
    (assuming it's on a network and isn't the machine serving the internet
    connection) will also cause the ondisconnect not to fire.

    What I like to do is set up a little client/server function where each client
    calls the server and updates a client variable with the current time, every 5
    seconds. Then, every 10 seconds I have a function on the server side run
    through the clients and make sure they've updated. If the server side function
    encounters a client who hasn't updated in the past 10 seconds, it calls the
    onDisconnect for that client.


    JayCharles Guest

  4. #3

    Default Re: onDisconnect not working as expected on IE7

    Since you are only interested in wether a client is connected when that person
    tries to login, all you have to do is set up a method on the client side
    NetConnection object which returns true. When a client tries to connect you
    check:
    (pseudocode)

    if(client not connected) {
    accept connection
    } else {
    call the client side method
    set a 5 second timeout to accept connection
    return null (set connection to pending state)
    }

    onMethodCallback {
    deny connection
    cancel timeout
    }

    /Johan

    ManMachine Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139