No flash for you? Graceful degradation in anti-flash devices (iP*d...)
In the last couple of years we used to integrate a lot of interactive flash content on our sites.
Flash gives to the end user a lot of interactive web richness that is nearly impossible to reproduce on other current tools we have today.
The emerge of html5 is very exciting and we can't wait for this protocol to gain more power - but with all that said in the current state it is still hard to give cool solutions to our clients that require a lot of logic or UI that is beyond the current capabilities of Jquery UI.
To integrate flash/flex content we use the highly recommended swftools module. It gives us the ability to add flash content using the "Drupal way" - simply by calling the swf()
function.
With our goal to extend our capabilities to the mobile industry, we wanted to make sure we can offer a nice user experience for devices that don't support flash. This is easily achievable using a built-in feature in swftools, that allows to replace the flash content with supported html markup (like image or html5 canvas).
here is how we do that:
<br><?php<br>$flash_replacement = '<img src="http://www.linnovate.net/taxonomy/term/image-replacement">'; //here you insert the replacement markup<br>$file = 'http://...'; // insert here the path of the swf<br>$args = array(<br> 'params' => array('width' => '100%', 'height' => '100%'),<br> 'othervars' => array(<br> 'html_alt' => $flash_replacement,<br> ),<br> );<br>print swf($file, $args);<br>?><br>
As you can see this is pretty straight forward - you just need to add a value to the 'html_alt' key inside the 'othervars' array and that's about it.
You can insert any markup you like (even a theme function).
Check out our home page flash banner as an example.