Please note that there is an issue with this version of SWFObject. When clicking links that use href=”javascript:” in them, it triggers the new onbeforeunload, which makes all your swf files dissapear. All users should upgrade to 1.4.4.
This release only contains a single fix for a new issue that occurs when using Flash Player 9.
If you have multiple swf files embedded in a single HTML page, and at least one of those files uses ExternalInterface to add a callback, when you leave the page you will get an error that says “Line 56: Out of Memory”.
This only occurs in IE – no other browsers are affected, and it only happens when using Flash Player 9 whether you are using SWFObject or not.
The problem is in some new Javascript code that was inserted into Flash Player 9 to fix a bug in the IE browser. This IE bug affected swf files that connected to streaming media servers – to learn more about it you can read this blog post.
After working with Adobe, we came up with a Javascript fix for the streaming media issue and I used a variant of this code in the 1.4.2 version of SWFObject. All was fine then, until Flash Player 9 was released, and it turns out Adobe included their own Javascript (that is very similar to the fix in SWFObject) to fix the streaming media problems in IE. The only problem is that the code they used doesn’t like it when there is more than one swf embedded in a page.
So to get to the point, this new version of SWFObject just removes the ‘bad’ code that Flash Player 9 inserts into the page and instead uses the cleanup code from the previous version of SWFObject that has been working fine for Flash Player 8.
Go grab a copy now – anyone using ExternalInterface needs to be aware of this issue and should upgrade their SWFObject script immediately if you have any pages with more than one swf embedded in it.
Here’s a direct download link, or you can get it out of the SVN repository, or visit the SWFObject page and get it from there.
I thought that clean-up code looked familiar… I blogged about this awhile back, thinking that it might not be a good idea to overwrite Adobe’s JavaScript since it may break in future revisions. Would you mind posting the fix by itself for those of us who would like to use it independently of SWFObject?
I agree that it’s a little risky overriding the javascript functions, but in this specific case, I knew exactly what the functions were put there to do, and there isn’t really any other option.
Since it’s built into Flash Player 9, many users will already have it installed, and there is no way to force a patch to them, so Adobe will be stuck with those users for a while (at least a couple of years/versions).
Now that the problem is public, they know that people will be overriding those functions if they need to, so I would hope that in the future if they need to modify those functions, they would take all of the fixes into consideration and work around it.
I update internet explorer beta 3 and the swfobject don´t work. I work whit swfobject around a year and half, but my ulimate page not add swfobject.
You probably need to uninstall/reinstall your Flash Player after you upgrade the browser.
Bug report.
Platform: WinXPSP2
Browser: IE6
Flash Ver: 8,0,22,0
SWFObject Ver: 1.4.3
I followed your ExternalInterface example to wire up a Flash file to some JS functions. Everything works fine in FF and Safari, but in IE when calling the AS function from JS, the entire Flash file just disappears. I checked out the 1.4.2 branch, and it then works fine in IE as well. Feel free to email me if you need more info or my code samples.
I upgraded to SWFObject 1.4.3 and now there is a margin under the Flash header in Firefox. It works fine in IE6.
My test page still looks ok, no margins there. Can you send me some example code, or post it somewhere? Maybe a page that uses 1.4.3 and the same page using 1.4.2 to show the differences?
Geoff:
Here are the links:
1.4
<1.4.3
Oops, that first link is v1.1.0
Similar to the problem that Jeff was seeing above, with 1.4.3 I find that the Flash bits disappear when following a link in IE 6 with Flash 9.
I’ve noticed that when using the flashversion.html sample in the 1.4.3 zip file I get NaN for the rev attribute versus 0 in version 1.4. (Using flash player 9.0.0) Can anyone else recreate this?
Could this possibly be an issue introduced with the 1.4.3 update?
It still shows 9.0.16 for me in Firefox + Safari. Is this only in IE? Have you tried reinstalling your Flash Player?
I had the same problem as Jed with IE and external interface. no workie.
IE just cacks out. Mozilla is seamless.
I can’t recreate that problem. I just upgraded my old ExternalInterface example page to the latest SWFObject and it works fine.
http://blog.deconcept.com/code/externalinterface.html
I did have a thought though: In 1.4.3, I changed the cleanup code to trigger ‘onbeforeunload’ instead of onunload, so I wonder if you are clicking a link with a href=”#” or something like that, maybe that is triggering the cleanup?
The cleanup then hides all the Object tags, which would cause the movies to dissapear… So have a look and let me know if you find out anything new.
I can send you a code sample of what I am doing- but my js function is fired off a href link.
If I navigate to a page having another activeX, the cleaning function makes IE 6 crash.
I wonder if we should not be unregistering the onbeforeunload function after it has been called once?!
Hi,
just to let you know I’m getting the same problem as Jed Hurt with the new version…
Works fine in firefox, but the flash flickers on then off – so a blank page is all I get in IE… I’m not using externalInterface at all, just the detect part..
Everything great when I revert to the previous version…
Cheers
I’ve updated the script to fix that issue – still doing some final testing, but it looks pretty good. If you want to test it out, you can get version 1.4.4 from svn.deconcept.com/swfobject/trunk/
I’ve just tried out the SVN version (dated today – 8/3) of 1.4.4 – it fixes my problems with Flash never showing up on IE, as well as a wealth of other issues (again, all on IE), but introduces a deal-breaker: Go from page 1 with an SWF to page 2 with an SWF and IE quits. Just up and quits. Not good…
BTW, I think SWFObject is incredibly useful (assuming I can make it continue to work on IE).
DC
Revise and extend here: Have not reproduced this on a colleague’s machine, and have noted that my Flash Player install looks screwy – reporting version 6 on IE, version 8 on Firefox (verified outside of SWFObject – it’s really 6 and 8!).
Will investigate here…sorry for pulling the fire alarm!
DC
Well it’s perfectly fine to have different versions on IE and Firefox. I’ll test with FP6 in IE – maybe it’s a specific problem related to that player?
I’d be curious to see if upgrading to 7 or 8 or 9 fixes the crash.
Hi, many thanks for SWFObject! I have just one question. How can I pass the parameters to page from movie (swf)?
The standart FSCommand method doesn’t work.
I have SWFObject v1.4.3 and Internet Explorer 6.
I have a page with multiple movies and I’m using ajax to change the page content.
My home page has 4 flash movies and when I hit in a link the div (the one that have the 4 flash movies) is changed (using the innerHTML property) according to the new content returned for the ajax call. Now that I have the new content in my div (now with 0 flash movies) I hit the refresh button and IE (only happens in IE) give me the error “Line: 55 Error: Object doesn’t support this property or method”.
I investigate and the problem seems to be, again, the function __flash_unloadHandler in the fp9, because when I hit refresh the objects referenced by this function no longer exists, due to the assignment of new content (from ajax) to the div using the innerHTML property.
I think that this problem will be solved when I upgrade to version 1.4.3, because you replace this function with an empty function. Well I was wrong. The function really is replaced but the event onunload of the window object still have a copy of this function on it and when window.onunload is fired (in this case when I hit the refresh button) the function is still executed!
The Adobe javascript code has an error, if they just add this line:
if( typeof chartObj == “undefined” ) return; to the first line of his __flash_unloadHandler function, everything will jus work perfectly.Can anyone help me out with this. please? I just don’t know what to do anymore!
Thanks in advance!
I also experience the problem with IE quitting when loading the next page. I am using IE6 with Flash Player 6.0.88.0 and SWFObject 1.4.4.
The problem seems to be in deconcept.SWFObjectUtil.cleanupSWFs. Calling typeof on all properties seems to crash IE. Not every time, but about 50% of the times, at least after a restart of IE (it appears to get immune, if other pages are visited before the page using SWFObject).
Replacing
if (typeof objects[i][x] == ‘function’) {
with
if (x != ‘FlashVars’ && typeof objects[i][x] == ‘function’) {
appears to fix the problem.
Can anybody confirm this, or is it just a coincidence?
This issue should be fixed in the latest version of SWFObject in svn. Grab it from here: svn.deconcept.com/swfobject/trunk/ and try it out.
Yes, the latest version from svn also appears to fix the problem I am experiencing. Thanks :-)
For my part the version 1.5 does not fix the problem with the two animations using ExternalInterface in the same page (Line 56: Out of Memory bug) on Flash Internet Explorer v9.0.16.0. SWFObject v1.5 also re-introduces an old bug that v1.4.2 haven’t. The bug is that when using ExternalInterface and using FMS with a persistent connection if you simply refresh the page, the animation is not unloaded from memory (I’m not sure if it is known as the streaming bug) and FMS does nor receive the signal to close the connection. Each time you refresh the page a new FMS connection exists (you can try it with a simple NetConnection.connect() line in a blank FLA). I have switched back to v1.4.2 and everything goes fine. I can try v1.4.3 or any other version if you make them public. Good luck. Do not hesitate to contact me, I have worked a lot on this sort of (cr..) things.
I’m getting the above problem with the most recent SVN version of SWFObject. Two swf’s on one page calling ExternalInterface causes IE to get Out of memory at line 56 on unload
I followed your ExternalInterface example to wire up a Flash file to some JS functions. Everything works fine in FF and Safari, but in IE when calling the AS function from JS, the entire Flash file just disappears. I checked out the 1.4.2 branch, and it then works fine in IE as well.