SWFObject API

arthurf - January 25, 2007 - 17:54

This is a small module that implements the SWFObject javascript library to make it easier to add flash to Drupal modules and themes. Because browsers have had issues with flash rendering (IE) javascript libraries can be used to improve the situation. The SWFObject library (http://code.google.com/p/swfobject/) is a good implementation.

There are two versions of this module which support the 1.5 and 2.x versions of SWFObject. Currently development is switching to support the 2.x versions, please use the 2.x versions of the module.

This module provides an easy theming function (which is compatible between both 1.x and 2.x versions of the module) which makes adding SWF files a snap:

<?php

   $url
= "myflashfile.swf"; //path to flash file
  
$params = array('width' => 100, 'height' => 100 );
  
$vars =  array(
    
'file' => base_path() . path_to_theme() .'/files/song.mp3',
    
'image' =>  base_path() . path_to_theme() ./files/image.jpg
    );
   print
theme("swfobject_api", $url, $params, $vars);

?>

To use this module, you must download the SWFObject library and place it in the swfobject_api module directory.

Please Note
This module is different than the swfobject.module as it is specifically designed to implement an API only. If you want to add flash blocks, you might want to look at that module.

This module is partially supported by CivicActions.

Releases

Official releasesDateSizeLinksStatus
5.x-2.0-beta22008-Sep-1112.55 KBRecommended for 5.xThis is currently the recommended release for 5.x.
5.x-1.2-152008-Apr-239.27 KBSupported for 5.xThis release is supported but is not currently the recommended release for 5.x.

Resources

 
 

Drupal is a registered trademark of Dries Buytaert.