jQuery SWFObject Plugin
The unique functionality of SWFObject available through jQuery.
Getting Started
Downloads
Features
Examples
License
Known Issues
Support
Features
$.flash.available
A boolean value of whether the user has the Flash plugin available for use.
return $.flash.available;
// returns true or false
$.flash.version
An object containing the major, minor, and build numbers of the user's Flash plugin.
return $.flash.version
// returns { major: 10, minor: 0, release: 22 }
$.flash.hasVersion()
A function which returns a boolean value of whether the user has installed the Flash plugin of at least the specified version.
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 you can modify containing the path and filename of the express installer.
$.flash.expressInstaller = 'myFlashPath/expressInstall.swf';
// Changes the express installer
$.flash()
A function which returns a standards-friendly jQuery'd flash object.
<script type="text/javascript">
/* Creates and saves a flash object "useLater" for later */
var useLater = $.flash.create(
{
swf: 'myFlash.swf',
height: 400,
width: 600
}
);
$(document).ready(
function () {
$.('#putFlashHere').html(userLater);
}
);
</script>
$(selector).flash()
A function which inserts a standards-friendly jQuery'd flash object into the selector.
$.('#putFlashHere').flash(
{
swf: 'myFlash.swf',
height: 400,
width: 600
}
);
$(selector).flash() Features
swf
Sets the path and filename of the Flash movie.
$.('#putFlashHere').flash(
{
swf: 'myFlashMovie.swf'
// Required to execute
}
);
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,
widht: 600
// Default is 320
}
);
hasVersion
Temporarily assigns the version of the Flash plugin required to display the Flash movie.
$.('#putFlashHere').flash(
{
swf: 'flash10.swf',
height: 400,
width: 600,
hasVersion: 10
// optional and temporary
}
);
expressInstaller
Temporarily assigns the expressInstaller to the specified path and filename.
$.('#putFlashHere').flash({
swf: 'myFlash.swf',
height: 400,
width: 600,
hasVersion: 10,
// optional and temporary
expressInstaller: 'justThisOnceExpressInstaller.swf'
// optional and temporary
});
flashvars
A string or an object that defines the data or variables to be passed into the Flash movie.
$.('#putFlashHere').flash(
{
swf: 'flashStatus.swf',
height: 400,
width: 600,
flashvars: {
person: 'Jonathan',
feels: 'good',
about: 'Beth'
}
}
);
params
An object that defines the paramaters to be passed into the Flash movie. This can include the Flashvars.
$.('#putFlashHere').flash({
swf: 'flashStatus.swf',
height: 400,
width: 600,
params: {
play: true,
loop: true,
flashvars: {
battleMode: true,
computer: true,
players: 2
}
}
});