Weblog

Inserting Flash with accessibility in mind

Outdated method, replaced by the newer one. Just keep it here for archive purposes.

Why

I've been doing a website lately that has to be accessible, but also has a menu based in flash. As I never used flash before I started to look for accessibility issues with flash and discovered nearly no one gives a shit about alternate contents, but worst, they insert their movies using javascript to detect flash version. This represents an accessibility problem since users that dont have javascript enabled wont be able to insert the object nor read the alternate content (if any).

Flash satay method

Then I remembered I'd read an article in A List Apart about how to make flash available with markup validating method. Basically this method is great because it only depends on the object tags and you can define an alternate content within the object (a link, an image, a list based menu, etc).

Example with MX movie
alternate content to MX movie
Flash satay code
<object type="application/x-shockwave-flash" data="index.swf" 
width="400" height="100">
	alternate content to MX movie
	<param name="movie" value="index.swf" />
</object>

Houston we have a problem!

When I tested the method, surprise! no workie! The alternate content doesnt show up in my no-plugin browser! To make it shorter, after much thinking I discovered my FireFox has the flash 5 plugin installed (I thought I didnt have any plugin). As I was trying to see an MX movie, the plugin didnt understand it, but had already loaded the object, so I wasnt able to see the alternate content either.

Flash satay method improved with a launcher

The possible solution (I should have many more test results with different configuration settings) is creating a flash 4 movie that will be a launcher. In frame 1 we execute the following actionscript:


vs = Number(substring(eval("$version"), 5, 1));
if(vs<6) loadMovie("flash4.swf",_root);
else loadMovie("index.swf",_root);

This way, if browser has a plugin version previous to 6 (Flash MX) it will load a flash 4 movie, which it can interpret. If it has the correct plugin it will be able to read the enhaced contents with a n MX movie. The only problem is when browser has a plugin version previous to 4, because we will be in same situation as the classic flashsatay, where it will try to load the launcher but will not understand it, thus not showing the flash nor the alternate contents. Luckily enough, there arent many people out there with plugin versions prior to 4, but there's still quite a lot of version 4 or 5 plugins out there.

Example with launcher
alternate content to launcher
Flash satay method improved with a launcher code
<object type="application/x-shockwave-flash" data="lanza.swf" 
width="400" height="100">
	alternate content to launcher
	<param name="movie" value="lanza.swf" />
</object>

Article written in july 2004. I thought it was interesting to update mini articles list using recent material.

Comments on this entry

  1. 2004-11-02 19:14:58

    You know, you could use JS to insert the Flash if the correct version is detected then the noscript tag acts as the alternate content if JS is disabled. If they have JS and no Flash (or the wrong version) you can still serve up the alternate content in the noscript tag using the DOM (at least I think you can).

Closed

Due to spam bullshit this weblog has been closed to comments, it was impossible to keep my blacklist script updated. You can still figure out my email and send me your message. Sorry.

Change preferences

Change preferences

License

Creative Commons 2001-2004. Sergi Meseguer

RSS syndication

rss (1, 2 ), xhtml, css, taw