Please turn on JavaScript. To find out how to do this visit the WebWise JavaScript guide.

A wrapper for a Flash movie so it can be embedded into a page

Further Info & Examples

Static Methods

version

Get details of the current users Flash plugin

Synopsis

glow.embed.Flash.version();

Returns

An object with details of the currently installed Flash plugin.

major (number)
Flash player major version mumber
minor (number)
Flash player minor version mumber.
release (number)
Flash player release version mumber.
actual (string)
The Flash version exactly as reported by the Flash player.
toString (function)
toString implementation in the form "major.minor.release" Eg "9.0.2"

Example

var version = glow.embed.Flash.version();
alert("curr = " + version.major) // "curr = 9"
alert("curr = " + version) // "curr = 9.0.2"

Constructor

new glow.embed.Flash(src, container, minVersion, opts)

Parameters

src
Type
String

Absolute or relative URL of a Flash movie file to embed

container
Type
selector | glow.dom.NodeList

The element to embed the movie into

If a CSS selector is provided then the first matching element is used as the container.

If the parameter is a glow.dom.NodeList, then the first element of the list is used as the container.

minVersion
Type
String | Object

The minimum required version of the Flash plugin.

The Flash plugin has a version numbering scheme comprising of major, minor and release numbers.

This param can be a string with the major number only, major plus minor numbers, or full three-part version number, e.g. "9", "9.1" , "6.0.55" are all valid values.

If minVersion is set as an object, it must use a similar structure to the object returned by the glow.embed.Flash#version method, e.g: {major: 9, minor:0, release:0}.

opts
Type
Object
Optional
Yes

Hash of optional parameters.

attributes

A hash of attributes to assign to the embedded element tag.

Type
Object
Optional
Yes
className

CSS class to be assigned to the embedding element.

Type
String
Optional
Yes
height

Height of the Flash movie. Defaults to "100%"

Type
String
Optional
Yes
id

Unique id to be assigned to Flash movie instance.

Type
String
Optional
Yes
message

Error handling message or function.

Type
String | Function
Optional
Yes

A message to display in the event that the Flash player is either not installed or is an earlier version than the specified minVersion. This message will be written into the container element instead of the Flash movie.

If a function is supplied, it will be invoked and any return value will be used as the message to write into the container.

params

A hash of optional Flash-specific parameters.

Type
Object
Optional
Yes

For example quality, wmode, bgcolor, flashvars.

width

Width of the Flash movie. Defaults to "100%"

Type
String
Optional
Yes

Examples

var myFlash = new glow.embed.Flash("http://www.bbc.co.uk/path/to/flash.swf", "#flashContainer", "9");
var myFlash = new glow.embed.Flash("http://www.bbc.co.uk/path/to/flash.swf", "#flashContainer", "9", {
  width: "400px",
  height: "300px"
});
var myFlash = new glow.embed.Flash("http://www.bbc.co.uk/path/to/flash.swf", "#flashContainer", "9", {
  width: "400px",
  height: "300px",
  params: {
    wmode: "transparent",
    flashvars: {
      navColour: "red",
      username: "Frankie"
    }
  }
});

Properties

container

The element containing the embedded movie.

isSupported

Does the user have the correct version of Flash?

Type
Boolean

Description

This will be false if the user has an earler version of Flash installed than this movie requires, or the user doesn't have any version of Flash instaled.

Example

if ( !myFlash.isSupported ) {
  alert('Please download the latest version of Flash');
}
movie

A reference to the actual Flash movie element, for direct script access.

Type
Element

Example

myFlash.movie.exposedFlashMethod();

Methods

embed

Embed the Flash movie into the document

Synopsis

myFlash.embed();

Returns

Example

var myFlash = new glow.embed.Flash(...);
myFlash.embed();
Documentation generated by JsDoc Toolkit 2.1.0 on Thu Jul 07 2011 12:47:28 GMT+0100 (BST)

BBC © 2014 The BBC is not responsible for the content of external sites. Read more.

This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.