Flash widgets description goes here
Download Flash WidgetsSWF Object Manager
The most recent versions of Internet Explorer (since April 2006) introduce a change into the way the browser presents embedded Flash movies to the user. Due to a patent dispute, users must now "click to activate" any Flash movie before interacting with it. The workaround to this problem is to use Javascript to write the relevant tags into the document following a page load. There are many different solutions available for handling this. This script however offers the cleanest approach to doing so, functions very similarly to the Community Widgets, and fortunately spins this unfortunate requirement into an opportunity by making it easier than ever to add Flash to a page, perform version detection, and even handle upgrades from older versions of Flash.
Dependencies
The following files are required in order for Flash movies to be injected:
- flash.js — Interprets XML configuration file and injects Flash movies after a page load
- flash.xml — Defines all instances and configuration of Flash movies
- expressinstall.swf — Powers the Express Install process
To add these to an existing page, the following must be added to the <head> element:
<link type="text/xml" class="AjaxWidgets" href="flash.xml" />
<script type="text/javascript" src="javascript/flash.js"></script>
Version Detection and Express Install
This script is able to perform version detection of the user's installed Flash plug-in. In the event that the user does not have the required version for a specified movie, the Express Install system introduced alongside Flash 8 is leveraged to perform an in-browser upgrade for anyone using Flash 6 or higher. If a browser restart is required, Express Install will bring the user back to the same page that required the upgraded version of Flash.
Note that the Express Install movie must be specified in the XML configuration file, as follows:
For Further Reference
- Microsoft — Information for Developers About Internet Explorer
http://msdn.microsoft.com/ieupdate/default.aspx - Adobe — Flash Player TechNote: Express Install FAQs
http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
Adding Movies to a Page
First, add an empty container to the page with a unique ID. For example:
<div id="flash-navigation"></div>
The next step is to inject a Flash movie into this container. Using the flash.xml file, a
- url — This is a URL to the SWF file relative to the XML file (Required)
- quality — Low | Autolow | Autohigh | Medium | High | Best
- width — A pixel or percentage value (i.e. 400 or 50%)
- height — A pixel or percentage value (i.e. 400 or 50%)
- bgcolor — Specifies a background color for the movie (example: #ffffff)
For Further Reference
- Adobe — Flash Player TechNote: Flash OBJECT and EMBED tag attributes
http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_12701
Flash XML Example
<?xml version="1.0"?>
<flash>
<movie id="flash-navigation" version="8" nocache="true">
<param name="url" value="/Flash/flash-navigation.swf" />
<param name="quality" value="High" />
<param name="width" value="600" />
<param name="height" value="50" />
</movie>
<movie id="flash-navigation" version="8.5">
<param name="url" value="/Flash/flash-feature.swf" />
<param name="quality" value="High" />
<param name="width" value="600" />
<param name="height" value="300" />
</movie>
<expressinstall url="/Flash/express.swf" />
</flash>
Passing Variables to a Flash Movie
In order to pass dynamic variables from a page into a movie, some Javascript must be added to the
element of the page. This Javascript will pass the variables to the injected Flash movie specified in brackets.<script type="text/javascript">
flashVars["headerdiv"] = "foo=bar&test=hello&href="+location.href;
</script>