deconcept swfObject bug debugged!
remember how i said my png transparency solution relied on deconcept’s swfobject? We noticed that whenever you clicked a link that left a page, it seemed that every embedded flash object was dumped from the page, collapsing holes and causing everything to look screwy for a second before the page switched.
for the record, this can be fixed by following these directions: http://lists.deconcept.com/pipermail/swfobject-deconcept.com/2006-August/001407.html
Or, just comment out these lines from the swfobject.swf
if (typeof window.onbeforeunload == 'function') {
var oldBeforeUnload = window.onbeforeunload;
window.onbeforeunload = function() {
deconcept.SWFObjectUtil.cleanupSWFs();
oldBeforeUnload();
}
} else {
window.onbeforeunload = deconcept.SWFObjectUtil.cleanupSWFs;
}
edit: for crying out loud, why dont any of my wordpress plugins for code formatting work???
edit 2:
Geoff at Deconcpet wrote me about this, and it was definitely a known issue. I’m previewing the next release of swfobject, which seems to have the problem locked down, although, i dont have the ability to test the main function of the cause of the bug: the release of swf’s with streaming content. I should have that soon, for testing, and will follow up a report on that.
Thanks, Geoff. You (and swfobject) are awesome.
This functionality was changed in the very latest version (although not quite released yet).
The change adds this function only if the user has IE, and only if their Flash player version is 8 or above (players that use ExternalInterface).
The issue was that if you had a streaming video, and you embed the movie using innerHTML, when you left the page, the audio would keep playing (and presumably the Flash plugin would stay in the browser memory).
To fix this, I implemented this fix, but then later noticed the issues you mention (among a couple of other small issues).
So in the next release this will be eased a little bit – you’ll still see this if you are using IE and have Flash Player 8+, but on all other browsers you’ll be just fine.
Oh, and I also should say: if you aren’t using streaming content and ExternalInterface in your Flash movies, it’s perfeclty fine to comment out that chunk of code.
Thanks for your comment on my blog, Geoff. I actually have some objects that will have streaming content…so I think i’m going to hook an additional argument in so that i can run that function only when i specify that argument(or not, as the case may be), the embedded objects with streaming content can be appropriately unloaded.
perhaps this would be a better way to handle this for your distributed version of the script? some kind of override to turn it off, maybe?
dude. awesome.