Web Development

SWFObject Customisations

Over time, requirements of SWFObject have been increased. Here are a few changes I have made.

Source Code: swfobject.js (7.93Kb)

Example of HTML

<script type="text/javascript">
var so1 = new SWFObject("flash.swf", "flashSWF", "400", "400", "8", "#FFFFFF");

// Sends HTML contained in the html element with the id
// sent to SWFobject as a flash variable called 'sHTMLContent'
so1.sendHTMLToFlash();

// A custom function that is called when flash IS NOT installed
so1.setAttribute('flashInstalledFunc','hide_nonflash_html');

// A custom function that is called when flash IS installed
so1.setAttribute('flashNotInstalledFunc','hide_flash_html');

so1.addParam("wmode", "transparent");
so1.write("flash");
</script>