*** UPDATE 10th Octover 2008 *** The bug has now been withdrawn from the SWFObject project since we are no longer convinced that SWFObject is the culprit here. In fact I'm having a hard time reproducing this problem now in anything but one application which uses the old Macromedia communication framework. With that particular app I can reproduce the problem regardless of browser and OS, whereas before the problem only surfaced for me on IE on Windows. I will post updated here as I find them. *** END UPDATE ***
I've just managed to iron out a nasty bug in one of my FMS apps and this issue will likely affect other applications.
One of my clients noticed that some users would show up multiple times in a userlist of one of my applications. The userlist was tied to a SharedObject and users were removed from this SharedObject as they logged off. I noticed that the issue only surfaces in Internet Explorer 6 and 7, regardless of the minor Flash Player version used.
Moreover (and this was the hard bit to figure out) the issue seemed to surface only on those pages which used SWFObject 2 or SWFObject 2.1 to embed the SWF. Any pages using a previous version of SWFObject (in particular I was using version 1.5) the problem did not occur.
My conclusion is therefore that the problem somehow lies with SWFObject and how it interacts with Internet Explorer. For some reason the onDisconnect event is not invoked on FMS (I was using FMS 2 in this particular app) when my SWF was embedded with SWFObject 2.0 or above and I have now rolled back to SWFObject 1.5. Hope this helps someone as it may easily have you pulling your hair out.

#1 by Aran on 8/7/08 - 12:33 PM
As a moderator o the swfobject project, I will log an issue here ( http://code.google.com/p/swfobject/issues/list ) . Could you please supply me a link to an app / test page which exhibits the behavior?
Cheers,
Aran
#2 by Stefan Richter on 8/7/08 - 12:43 PM
#3 by Jay Charles on 8/7/08 - 1:35 PM
In the end, I'm still using the old "heartbeat" connection checking method in any application that relies on timely detection of clients leaving... seems that's the only bulletproof way of doing it.
Also, I tend to do things to prevent duplicate entires in user lists to account for the "fudge" time I allow in the hearbeat routine. I typically check the userlist object for matches, and then disconnect the client associated with the old entry before adding the new client to the list (sort of how Yahoo IM handles their logins... new client bumps old client). Of course, this assumes that the application requires registration of user names (most of mine do).
#4 by eitanpo on 8/7/08 - 2:42 PM
#5 by TK on 8/14/08 - 7:45 PM
#6 by Stefan Richter on 8/14/08 - 8:47 PM
#7 by Stephen Beattie on 9/8/08 - 5:07 PM
swfobject.addDomLoadEvent( function(){
swfobject.removeSWF( my_div_id );
});
Does the trick for me (using SWFObject v2.1 beta7).
Hope this helps.
#8 by Flug on 9/10/08 - 10:08 AM
#9 by George Kosch on 10/25/08 - 4:29 PM
Firefox, opera, chrome all work fine everytime.
The problem, it seems, is IE won't "leave" pages until it's closed no matter what.
Any ideas on this one?
#10 by Stefan Richter on 10/25/08 - 7:26 PM
could you email me please (stefan AT flashcomguru.com) and if possible send me your application. Someone at Adobe is looking into the issue and it would help if I had more cases to show them.
I have one application however which shows this behaviour in other browsers too and I am not yet sure why this is happening.
#11 by George Kosch on 10/25/08 - 10:12 PM
This must be an IE issue with live fms video where the browser "just won't let go" until you close it down completely.
You can get a free account and see for yourself if you have a newer version of IE 7 or beta 8. Again, other workstation with IE (older) is fine.
Stefan, I sent you some stuff on this via hotmail account - just in case it's in your spam folder :)
#12 by George Kosch on 11/13/08 - 2:49 PM
#13 by cheinan on 6/14/10 - 3:21 PM
this is the final working solution:
on server side:
application.onConnect = function(client)
{
client.intervalId = setInterval(checkForAlive, 8000, client);
}
function checkForAlive(client)
{
var res = new Object();
res.client = client;
res.onResult = function(val)
{
client.isCon = 1;
}
client.call("checkIsCon", res);
//trace(client.isCon);
if(client.isCon == 0)
{
application.disconnect(client);
clearInterval(client.intervalId);
}
else
{
client.isCon = 0;
}
}
on the user swf:
function checkIsCon()
{
return true;
}
thats it - working like charm...
#14 by cheinan on 6/14/10 - 3:24 PM
here the fix:
application.onConnect = function(client)
{
client.isCon = 1;
client.intervalId = setInterval(checkForAlive, 8000, client);
}