[SWFObject] Bug: IE and ExternalInterface.addCallback()

daniel.zabinskas at immersive.com.au daniel.zabinskas at immersive.com.au
Wed Aug 2 22:23:55 PDT 2006


It seems there is a bug in IE when you embed an swf that uses the
ExternalInterface.addCallback() method using swfobject.js.

Any javascript call on the same page triggers the window.onbeforeunload
handler. Because of this the flash file disappears because the flash objects
style.display is set to "none" in the deconcept.SWFObjectUtil.cleanupSWFs
function.

In my project, I commented out the following if statement in the
swfobject.js file:

if(typeof window.onbeforeunload=="function"){
    var oldBeforeUnload=window.onbeforeunload;
    window.onbeforeunload=function(){
        deconcept.SWFObjectUtil.cleanupSWFs();
        oldBeforeUnload();
    };
}else{
    window.onbeforeunload=deconcept.SWFObjectUtil.cleanupSWFs;
}

And now it works fine. Luckily, I don't have any streaming content in my
flash file. I have attached some files that show the bug in action.

Thought you might like to know.

Cheers
Daniel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: flash.fla
Type: application/octet-stream
Size: 47616 bytes
Desc: not available
URL: <http://lists.deconcept.com/pipermail/swfobject-deconcept.com/attachments/20060803/0b1e633d/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: swfobject.js
Type: application/octet-stream
Size: 6466 bytes
Desc: not available
URL: <http://lists.deconcept.com/pipermail/swfobject-deconcept.com/attachments/20060803/0b1e633d/attachment-0001.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: index.html
URL: <http://lists.deconcept.com/pipermail/swfobject-deconcept.com/attachments/20060803/0b1e633d/attachment.asc>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: flash.swf
Type: application/octet-stream
Size: 11133 bytes
Desc: not available
URL: <http://lists.deconcept.com/pipermail/swfobject-deconcept.com/attachments/20060803/0b1e633d/attachment-0002.obj>


More information about the Swfobject mailing list