Sony BMG — Production Guide

Flash Widgets

Flash widgets description goes here

Download Flash Widgets

SWF 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:

Download SWF Object Manager

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

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 element should be added and given the same unique ID as the container. The version attribute defines what version of Flash the movie was exported as. Another attribute, nocache, instructs the browser to not cache the movie when set to true. Additional parameters that further define the movie are available — these are detailed below:

For Further Reference

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>

Contents