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
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:
$flash_replacement = ''; //here you insert the replacement markup
$file = 'http://...'; // insert here the path of the swf
$args = array(
'params' => array('width' => '100%', 'height' => '100%'),
'othervars' => array(
'html_alt' => $flash_replacement,
print swf($file, $args);
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.