Skip to main content

Features

$.flash features

$.flash.available

A boolean value of whether or not the user has the Flash plugin available to use.

return $.flash.available; // returns true or false
$.flash.version

An object containing version information about the the user's Flash plugin.

return $.flash.version

/* returns {
	array: [10, 0, 45],
	major: 10,
	minor: 0,
	release: 22,
	original: 'Shockwave Flash 10.0 r45',
	string: '10.0.45'
} */

$.flash.hasVersion()

A function which returns a boolean value of whether the user has installed the minimum specificed version of the Flash plugin.

return $.flash.hasVersion(9.1); // returns true if at least Flash 9.1 or greater is detected
$.flash.activeX

A boolean value of whether the browser uses Flash via activeX.

return $.flash.activeX; // returns true or false
$.flash.expressInstaller

A string that sets the filename of the express installer that will always be used.

$.flash.expressInstaller = 'myFlashPath/expressInstall.swf'; // changes the express installer
$.flash.encodeParams

A boolean value of whether the params will always be URI encoded.

$.flash.encodeParams = false; // default is true
$.flash()

A function which returns a standards-friendly jQuery'd flash object.

var useLater = $.flash.create(
	{
		swf: 'myFlash.swf',
		height: 400,
		width: 600
	}
);

$(document).ready(
	function() {
		$.('#putFlashHere').html(userLater);
	}
);

$().flash features

$(selector).flash()
$.('#putFlashHere').flash('myFlash.swf');
swf

Sets the path and filename of the Flash movie.

$.('#putFlashHere').flash(
	{
		swf: 'myFlashMovie.swf'
	}
);
height

Sets the height of the Flash movie.

$.('#putFlashHere').flash(
	{
		swf: 'flashStatus.swf',
		height: 400 // default is 180
	}
);
width

Sets the width of the Flash movie.

$.('#putFlashHere').flash(
	{
		swf: 'flashStatus.swf',
		height: 400,
		width: 600 // default is 320
	}
);
hasVersion

Assigns a minimum version of the Flash plugin required to display the movie.

$.('#putFlashHere').flash(
	{
		swf: 'flash10.swf',
		height: 400,
		width: 600,
		hasVersion: 10 // requires Flash 10
	}
);
hasVersionFail

Assigns a function to be run when the hasVersion requirements are not met.

$.('#putFlashHere').flash(
	{
		swf: 'flash10.swf',
		height: 400,
		width: 600,
		hasVersion: 10, // requires Flash 10
		hasVersionFail: function (options) {
			console.dir(options); // look at all the useful goodies

			return false; // returning false means the expressInstaller document will not be used
			return true; // would have let the expressInstaller document be used
		}
	}
);
expressInstaller

Assigns a new expressInstaller for the movie if the minimum version is not met.

$.('#putFlashHere').flash(
	{
		swf: 'myFlash.swf',
		height: 400,
		width: 600,
		hasVersion: 10,
		expressInstaller: 'heyUseThisExpressInstaller.swf' // sets the express installer
	}
);
encodeParams

A boolean value of whether the params will be URI encoded.

$.('#putFlashHere').flash(
	{
		swf: 'myFlash.swf',
		height: 400,
		width: 600,
		encodeParams: false,
		flashvars: {
			something: 'will not be encoded & stuff = crazy' // whoa, whoa, use at your own risk 
		},
		somethingElse: 'isn\'t getting encoded either, yo.'
	}
);
flashvars

A string or an object that defines the data or variables to be passed into the Flash function.

$.('#putFlashHere').flash(
	{
		swf: 'flashStatus.swf',
		height: 400,
		width: 600,
		flashvars: {
			name: 'Jonathan',
			feeling: 'depressed',
			about: 'women'
		}
	}
);
Other parameters

Paramaters may be passed directly into the $.flash function.

$.('#putFlashHer').flash(
	{
		swf: 'flashStatus.swf',
		height: 400,
		width: 600,
		allowFullScreen: true,
		wmode: 'transparent',
		flashvars: {
			battleMode: true,
			computer: true,
			players: 2
		}
	}
);