October 07, 2003
Here Comes The EOLATOR

For all of you that are too lazy to read all the following introduction, jump right ahead to EOLATOR my automatical HTML page transformer that does all the ugly activeX to javascript work that lies ahead for you.

By now we all should have heard it - as Microsoft wants to save themselves some 521 million dollars they will soon make some updates to their Internet Explorer that allow them to sneak out of one of these absolutely bogus trivial patent cases. Unfortunately this little update will cause an alert box to pop up whenever an active-x plugin inside an HTML page is started. This is something that affects us flash developers painfully. Fortunately Macromedia has already published some possible cures that you will have to apply to all sites that you've ever built that use flash.

I had a look at the scripts that Macromedia provides - looks like solid work, nicely documented, the compatibility charts suggest that there has been lots of testing. But: why is this code so huge? Why is the way that the data is written so complicated and error prone? It looks like you will have to go by hand through your <OBJECT> tags, pick out the correct name/value pairs and paste them one by one into some javascript function. This is a process where in 1 out of 10 cases you will either loose some letters, mix up the order or forget some tags. And it's too much work if you have to update some dozens of pages. Unnecessary work I think.

That's why I made some tests with the IE beta that Microsoft offers and came to the following result: the only thing that really has to come from an external Javascript file is the "document.write()" command that dynamically places the <OBJECT> tag into the page. You can leave all the real data inside the HTML page. That includes the <OBJECT> data itself - in form of javascript of course.

What I don't like about Macromedia's solution is that I have to wade through old <OBJECT> tags which consist out of even more <PARAM> tags and sort them all out. What I prefer is to simply cut out the whole block and paste it into some javascript expression. But stop! Don't forget that we are possibly dealing with various quotation marks like " or ' or even linebreaks which forces us to wrap up that textblock in a way that it cannot break our javascript routine. Here comes PHP in very handy - I use its "urlencode" command to create a format that can be mindlessly put between quotation marks. And javascript offers a neat counterpart in the form of "unescape". And that's it. The final result looks like this:

<script language="JavaScript" type="text/javascript" src="quasimondo_vs_eolas.js"></script>
<script language="JavaScript" type="text/javascript">
insertObject(unescape("%3COBJECT classid%3D%22clsid%3AD27CDB6E-AE6D-11cf-96B8-444553540000%22%0A codebase%3D%22http%3A%2F%2Fdownload.macromedia.com%2Fpub%2Fshockwave%2Fcabs%2Fflash%2Fswflash.cab%23version%3D6%2C0%2C79%2C0%22%0A WIDTH%3D%22600%22 HEIGHT%3D%22130%22 id%3D%22eolator_head%22 ALIGN%3D%22%22%3E%0A %3CPARAM NAME%3Dmovie VALUE%3D%22eolator_head.swf%22%3E %3CPARAM NAME%3Dquality VALUE%3Dhigh%3E %3CPARAM NAME%3Dbgcolor VALUE%3D%23CCCC99%3E %3CEMBED src%3D%22eolator_head.swf%22 quality%3Dhigh bgcolor%3D%23CCCC99 WIDTH%3D%22600%22 HEIGHT%3D%22130%22 NAME%3D%22eolator_head%22 ALIGN%3D%22%22%0A TYPE%3D%22application%2Fx-shockwave-flash%22 PLUGINSPAGE%3D%22http%3A%2F%2Fwww.macromedia.com%2Fgo%2Fgetflashplayer%22%3E%3C%2FEMBED%3E%0A%3C%2FOBJECT%3E"))

Okay - this doesn't look as nice as Macromedias version, but it also doesn't need a 7K and a 5K external library - my quasimondo_vs_eolas.js is just 53 byte.

I have turned this into a little widget called EOLATOR which you are free to use - AT YOUR OWN RISK of course. The pages that I have converted until now work fine, but all this is so fresh that we don't know if Microsoft even get's through with their little trick. Should you come across any errors - the comments are yours:

Posted at October 07, 2003 10:23 PM | Further reading

i think you have just saved the whole flash community a few colletive thousands hours of despisable work... kudos!


Posted by: alessandro on October 8, 2003 01:54 AM

hihihi, mario, you rock! I bet this will definitivelly close that thread over at FC. Now let's mock this up with mook's fpi, and we should be able to say bye bye to this whole eolas cr@p:)

Posted by: Marcos on October 8, 2003 07:45 AM

When I put this address into the eolator page:


it says:
There were no Active-X objects found in this page. You do not have to exchange it.

Cool for sure!!! Great Work...

Posted by: Amit on October 8, 2003 10:03 AM

Amit: That page has of course already been processed with the Eolator...

Thanks for the positive feedback guys!

Posted by: Mario on October 8, 2003 10:08 AM

Excellent work man!

I was just wondering, what would happen if I don't use OBJECT tag, but simply make page in frames and link swf directly to one of the frames. Would this also be affected in new version of IE? And since there is no HTML and OBJECT tag, that means that it would not be possible any more to simply show swf in the browser?

Posted by: Shock on October 8, 2003 12:44 PM

Shock - I just checked that with the IE beta and as expected this doesn't trigger the alert box. The problem is of course that you will always get a full screen (or full frame) swf. And you don't have control over the scaling/quality etc. - but you could do that from inside the flash of course. Interesting approach indeed.

Posted by: Mario Klingemann on October 8, 2003 12:52 PM

Awesome! You deserve a nobel or something :D

Posted by: roro on October 8, 2003 07:35 PM

In spanish? ;)

Posted by: David on December 22, 2003 12:32 PM

Good service

Posted by: Frank Johnson on November 24, 2005 10:19 AM


Posted by: fendy on February 3, 2006 10:38 AM
Post a comment

Email Address:



Remember info?

Thank you!

Most Visited Entries
Sketches, Works & Source Code
In Love with
Powered by
Movable Type 2.661

© Copyright Mario Klingemann

Syndicate this site:
RSS 1.0 - RSS 2.0

Quasimondo @ flickr
Quasimondo @ LinkedIn
Quasimondo @ Twitter
Quasimondo @ Facebook
Quasimondo @ MySpace
Quasimondo is a Bright
Citizen of the TRansnational Republic
My other blog in german

My family name is written Klingemann,
not Klingelmann, Klingeman, Klingaman, Kingemann,
Kindermann, Killingaman, Klingman, Klingmann, Klingonman
Klingemman, Cleangerman, Klingerman or Kleangerman

profile for Quasimondo at Stack Overflow, Q&A for professional and enthusiast programmers