Working on one huge project is always a challenge. Recently I got a challenge of including a streamable flash player into our application.
Since I’m a web-standards fan, I do not think that the use of HTML markup generated by Flash is acceptable since it’s not valid at all (yes, we’re using XHTML 1.0 here at Wildbit). Another problem is that new MSIE update comes with brand new inclusion of Active-X objects into the HTML pages. It means that “…users cannot directly interact with Microsoft ActiveX controls loaded by the APPLET, EMBED, or OBJECT elements“ (more information about this).
Here the problem begins…
It works fine in all Gecko-browsers such as Mozilla, Firefox etc. But it crashes on MSIE. Whoa, I’m not surprised at all! I started to discover the issue, but I couldn’t find any solution over the Internet. Seems strange to me…
So, I decided to modify the SWFObject method of including flash movies into pages. Natively SWFObject modifies DOM “on-the-fly”. I’ve created 2 new functions in my global.js file – registerSWFObject and initSWFObjects. The first collects all markup and ID’s of elements to include to generated by SWFObject into an array. The second one includes all collected flash objects into the document. Calling the initSWFObjects function on initialization stage solves the problem.
PS: I’ve looked at Adobe web-site trying to find something there, and found out that it uses the same modification of SWFObject too. It seems the problem lies not on onDOMready extension, but rather then in new MSIE behavior or even in new Flash 9 plug-in.