Unobtrusive Flasher
This loads Flash movies using SWFObject, but it puts all the options into a hidden input element.
Requirements
Download
Get the file by downloading: flasher.js
Instructions
- Download the file and save to your website.
- Include the SWFObject library file.
- Include the MooTools library (if you haven’t already)
- Include the flasher.js file.
- Make a
<div>
element for each movie you want to embed, with optional alternate content. - Put a hidden input field inside each div with a "flasher" class, and the options you want the movie to use.
Example
For example, this could be the HTML for your site:
<html> <head> <script type="text/javascript" src="/js/swfobject-2.2.js"></script> <script type="text/javascript" src="/js/mootools-1.2.3-core-yc.js"></script> <script type="text/javascript" src="/js/flasher.js"></script> </head> <body> <div id="mymovie"> <input class="flasher" type="hidden" value="{ url: '/swf/mymovie.swf', params: { quality: 'high', wmode: 'transparent', base: '/' } }" /> </div> </body> </html>
Options
Same as the SWFObject options, but with these additional ones:
- url: location of the .swf file, required
- width: width of movie, defaults to 320
- height: height of movie, defaults to 240
- version: Flash version, defaults to 9.0.0
License
“Have Your Way With It™” — MIT License
Comments