Microsoft lost the battle. We find the solution.

Well, recently Microsoft lost a legal battle with a patent holder about the way IE is going to display objects and embeds in web pages. Those who have Flash, QuickTime and etc on their website suddenly find that their visitors need to activate the plugin before IE start playing them. Especially those who uses Flash for their navigational, their user need to activate the Flash before the navigational work. This is starting to be such a pain but I’ve found a way to solve this problem. To fix the problem, please follow these steps:

  1. Just below the last <object> in your HTML page, insert the following Javascript:

    <script type="text/javascript" src="fixit.js"></script>

  2. Open a new document in Notepad or your HTML editor, and copy & paste the following content into it:

    theObjects = document.getElementsByTagName("object");
    for (var i = 0; i < theObjects.length; i++) {
        theObjects[i].outerHTML = theObjects[i].outerHTML;
    }

  3. Save this file as fixit.js

Thanks to Mix-FX for the solution.

21 comments so far

  1. Stan says:

    Hmm, what if I don’t use the object tag but only the embed? :)
    For example if you upload Flash to your site using a CMS with FCKEditor, it doesn’t put the object tag, but only the embed.
    Is it going to work if I modify it to
    theObjects = document.getElementsByTagName("embed“);

  2. Ron says:

    Yes, in an ideal world, I guess that would be much easier. However, embed is not part of the HTML specification, so if you were to go the embed way, your code is never going to be valid. The Flash Satay article at A List Apart is a good article on that, plus it proposes a solution.

  3. T says:

    If you are using a behavior for shockwave/flash control from Dreamweaver…..such as, “go to frame” of the swf you are loading….
    This JS. script somehow messes that all up and the swf can only start from frame 1.

    Whats the fix for that???

  4. Tom says:

    Thank you for this information. I tried this solution on a few of my sites and when they load I get a loading message that says, “(2 items remaining) Opening page http://www….com

    Is anyone else experiencing this problem? Thank you very much!

  5. Jimbo says:

    I tried this for some streaming video and it breaks the video in both IE6 and 7. Does anyone know why?

  6. Ajax Man says:

    This isn’t working for me, i have the code in my javascript but it isn’t touching my flash on the page. why?

  7. Ajax Man says:

    Nevermind I got it, Thanks a lot

  8. gavin hardman says:

    The flash movies will be downloaded twice - Once as the page is passed, a 2nd time when the code is activated -

  9. sisi says:

    I have the same problem:

    “I tried this solution on a few of my sites and when they load I get a loading message that says, “(2 items remaining) Opening page http://www….com”

    Any ideas how to correct this?

    I have xp sp2, latest flash player.

  10. Ron says:

    A very important thing to note is that the function definition of fixit MUST BE in an external .js file, and not simply included in the HEAD tag. Otherwise, your Flash assets may appear to be “untouched”. Hope this saves some of you hours of troubleshooting.

  11. mary ann says:

    I am also having the problem “2 items remaining”. Then the info bar will show “1 item remaining” and the browser will continue to try and load the 1 item, whatever it is. What is the solution for this problem? Thank you in advance.

  12. Ron says:

    It seems many of you have been having that “2 items remaining” problem. Frankly, we haven’t encountered that at all on our side, and so we can’t tell what’s wrong and what needs to be fixed. Anyone else has any suggestions on what could be wrong?

  13. TannerD says:

    I’m also encountering the problem in IE 7 with “loading 1 item”. However, the browser doesn’t ask the user to click and “activate” the flash content. In fact the swf file plays as it should and everything seems well with the world.

    The “loading one item” seems to be just an error message, but the problem is the page is apparently not fully loaded. The little spinning circle spins making the user think something is wrong when the page is behaving as designed.

    I’ve tested this a bunch of times and it happens everytime I load the page. I’m using IE7 and XP with SP2. I tried this on two older machines with the IE7 - XP SP2 config and got the same results many times over.

    I tried it with a new machine running XP SP2 IE7 and the page does finish. However, if you look in the bottom left hand corner of the browser, there is a little error symbol and the “Done” text. If you mouse over that error sign the message will change to “Done, with errrors”. Are you not seeing even this message? If you are not seeing this error message, maybe you are using a Microsoft server? I’m using linux, so that could be what is different.

    Either way, would it be possible for you to direct me to a page where you are using with this solution? I’d love to point one of my machines to it and see if I get the problem still. I’ve been working on this a bunch today so it would be a great sanity check for me.

    thanks,
    - T

  14. TannerD says:

    Damnit, I hate it when I make stuff harder than it is.

    I had embed inside my object tag.

    That is the problem. Those of us using dreamweaver and not paying attention have an embed inside our object tag.

    The fix is to use instead of an embed inside the object.

  15. TannerD says:

    I was wrong about the embed tags being the cause.

    This is still happening on my site.

    You can see my test at manheimdealertraining.com/simulcast

    Ron, I’d love to see an example of your implementation of this solution so I can see if I get the error. I am back to wondering if you are using an MS or linuix server.

    thanks,
    - Tanner

  16. Kathryn says:

    Hello,

    How will I know that the problem already gone? Because sometimes my website www.orvisions.net loaded twice, and Flash testimonail did not load text from text file.

    Thank you,
    Kathryn

  17. Mike says:

    Ron, place your files in a web site and access it using a URL rather than the file system. It only presents the item remaining issue when run from a web site. Both Apache and IIS. It works fine if you place an alert(anything); prior to the for loop. Possibly other locations as well. It appears to have to with the web server software not terminating the load to the browser. The browser hangs expecting more. Some ideas???

  18. Daniel Dhillon says:

    The fix to this problem is to provide an absolute reference to the object in question. You can either put the entire URL in the href or object param or embed or whatever, OR you can put a base href tag with the base URL in your head. I tested this (on a live server) and it works perfect every time.

  19. LS says:

    the fix works for my flash buttons, but “kills” my flash videos - use Dreamweaver

  20. Dan Owen says:

    Does anyone know if it is possible to launch Dreamweaver behaviors from inside a Flash SWF? I mean simple things like Show/Hide and Set Text, etc.

    Thank you.

  21. Dusty says:

    This article could also help: Flash IE7 Fix

(will not be published)

Live Preview:

Note: We believe that everyone should be heard, so comments here are not moderated. However, comments that are found to be off-topic, inflammatory or otherwise inappropriate will be removed. Repeat offenders will also be banned from commenting.