Because of the well known Eolas patent issue regarding Internet Explorer and users having to click to activate Flash content a number of Javascript libraries has emerged to get round this problem e.g swfobject, UFO. The reason being that any Flash content loaded up through script was not affected by this patent issue and the user did not have to click anything.
I along with many others implemented generic functions to get round the "click to activate" problem. However since March of 2008 the issue has been resolved and current versions of Internet Explorer and any previous versions that have had patches applied to them do not have this issue. Therefore I am wondering whether there is any point in having Flash content delivered through Javascript rather than Server side code?
The main reason for doing it this way has been removed and by using Javascript to load all Flash you are narrowing your user base. More and more users are crawling the web with Javascript de-activated and I imagine that in this security conscious times we live in that this percentage will only increase. Checking my logged traffic statistics for today I can see that 10% of my sites non crawler users have Javascript disabled so this is quite a large number of users that won't be able to see all those Flash adverts and banners that your customers have paid £££ to place on your site.
Therefore in any new sites that I create I am reverting back to generating the Flash HTML server side unless there is a need for client side user interaction such as when I use flash for text counters. I am using the same XHTML that SWFobject and others have started doing which checks the users browser type and outputs the relevant OBJECT code accordingly i.e classid and codebase for IE and type for the others. This removes the need for embed tags and is still XHTML compliant plus its done server side so there is no issue when users turn Javascript off.
<object type="application/x-shockwave-flash" data="/images/Banner.swf" id="BANNER643" align="middle" width="468" height="60">
<param name="movie" value="/images/Banner.swf">
<param name="allowScriptAccess" value="sameDomain">
<param name="quality" value="high" />
<param name="wmode" value="transparent">
</object>
If the users browser is Internet Explorer I output a Javascript function call at the bottom of the page that will "fix" any OBJECT tags so that any users that don't have patched versions of IE and so still ask the user to "click to activate" will not have this problem as long as they have Javascript enabled.
A simple version of the EOLAS fix code is below although I am currently using a more advanced option that handles complex OBJECT params alot better.
objects = document.getElementsByTagName("object");for (var i = 0; i < objects.length; i++){objects[i].outerHTML = objects[i].outerHTML;}
All my users should get this content and only the unpatched Internet Explorer users who have Javascript disabled will have the inconvenience of being asked to "click to activate".
It would be nice to be able to detect whether Internet Explorer users had patched or unpatched versions so that I could only run the Javascript fix code if it was absolutely necessary but I cannot think of a way to determine this. I was thinking of maybe trying to access the first flash movie on a page and check the PercentLoaded property which must be unavailable if the flash movie is unactivated. However using the multiple IE version hack to run IE 6, 5 etc you always get a pop up saying "Press okay to continue loading content" when a page contains Flash so I cannot test this out. Either way this seems the best way to code Flash for the future as it ensures the maximum user coverage and still handles the EOLAS patent problem for those IE users who have not updated.
If anyone can think of any other reasons to be using Javascript and limiting your user coverage then please let me know.
2 comments:
A situation where an undetermined number of banners need to be displayed one after the other in the same spot on the website, some flash and some gif/jpg exists my side. I use ajax to load the banner specs and then javascript in a timer loop to display / remove the banners.
My actual question comes from trying to detect clicks on the banners. The flash component refuses to give up its first right to the mouse click event. It has yielded z-order to allow jquery jtips to show over it, though.
I would naturally be delighted and impressed with pointers to a solution.
I take it your only having problems with the flash movies and not the jpeg/gif banners? If thats true then has the flash object your using to display the banner been developed with an onclick event handler in the movie as wrapping an anchor round it will not work. I have had the same issue on my jobboard sites where I need to record the click through and also redirect the user to a specified site. The way we solved it was to use wrapper flash objects (like the satay method) which would play a movie that was passed to it as a parameter and also had a built in click event which would always look for a parameter value of qry and then redirect to that URI. This way we would always pass a value to a "logging" page that would log the hit against the relevant banner and then redirect to a specified URI which was also passed as a parameter value to the movie. Unless your flash movie has been developed to respond to onclick events you will not be able to hack it by other means. Hope this helps.
Post a Comment