SWFObject API

arthurf - January 25, 2007 - 17:54

Please Note!
In the hopes of reducing module duplication, the functionality of this module will be merged into SWFTools' SWFObject2 module sometime in the near future. For more information, please follow this thread: http://drupal.org/node/135063. There will be a comatibility layer, so for modules which implement this module's API, you will not have to change any code (though it's pretty easy to switch over to SWFTools SWFObject2 format.

Bug fixes for the current codebase will continue, however no new functionality will be released.

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. Drupal 6+ versions will only support SWFObject 2.x and higher.

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
6.x-1.0-beta12009-Jan-279.93 KBRecommended for 6.xThis is currently the recommended release for 6.x.
5.x-2.0-beta32009-Jan-2713.03 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.


 
 

Drupal is a registered trademark of Dries Buytaert.