Flash and Internet Explorer ActiveX focus issue

Saturday, February 24th, 2007

I’ve been doing most of my development on the Mac these days so I haven’t touched Internet Explorer. I’ve also been avoiding general HTML and been using Flash because dealing with browser incompatibilities makes my head spin. So who would have thought that there might be a slight user interface issue regarding Flash and IE?

If you publish your .swf and .html, Flash puts in the necessary OBJECT and EMBED tags in there for you. This works in all browsers EXCEPT for IE on Windows. OK, it doesn’t necessarily render your Flash movie unusable, but it does require that the user click on the Flash movie BEFORE you can actually interact with it. Here’s the Adobe article that explains it and contains a Javascript fix. It’s an annoyance for the user or the the user might think that the Flash movie is broken. The fix requires two Javascript libraries and a call to one of the the functions to embed your movie so that you don’t get see that weird behavior in IE for Windows.

Now, if you are passing GET style parameters to your flash movie inside your EMBED and OBJECT tags, you’ll have to modify one of the functions to accommodate these parameters.Add this in AC_RunActiveContent.js:

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
...
switch (currArg){
case "GET_parameters":
ext = ext + "?" + args[i+1];
break;

...

}

So, if you want to pass two parameters to your Flash movie, greeting and foo, now your javascript call will look like this instead:

AC_FL_RunContent('GET_parameters','greeting=hello&foo=bar','codebase',
'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0',
'width','320','height','240','src','test_flash_movie','quality','high',
'pluginspage','http://www.macromedia.com/go/getflashplayer',
'movie','test_flash_movie' ); //end AC code