embedSWF() Function and Arguments
This section describes the embedWF() function provided in SWFObject 2 and its 5 required arguments and 5 optional arguments.
Embedding a simple SWF file using SWFObject is easy.
Embedding more complex SWF files requires us to read the embedSWF() function
and it 5 required arguments and 5 optional arguments more carefully:
swfobject.embedSWF(swfUrl, id, width, height, version, expressInstallSwfurl,
flashvars, params, attributes, callbackFn):
- swfUrl (String, required) specifies the URL of your SWF
- id (String, required) specifies the id of the HTML element (containing your alternative content) you would like to have replaced by your Flash content
- width (String, required) specifies the width of your SWF
- height (String, required) specifies the height of your SWF
- version (String, required) specifies the Flash player version your SWF is published for (format is: "major.minor.release" or "major")
- expressInstallSwfurl (String, optional) specifies the URL of your express install SWF and activates Adobe express install. Please note that express install will only fire once (the first time that it is invoked), that it is only supported by Flash Player 6.0.65 or higher on Win or Mac platforms, and that it requires a minimal SWF size of 310x137px.
- flashvars (Object, optional) specifies your flashvars with name:value pairs
- params (Object, optional) specifies your nested object element params with name:value pairs
- attributes (Object, optional) specifies your object's attributes with name:value pairs
As you can see, embedSWF() is powerful, it allows to enter everything we can enter in "object"
element through this single function call. See the next section for an example on using "flashvars"
Last update: 2014.
Table of Contents
About This Book
Introduction of Adobe Flash
Adobe Flash Player Plugin for Firefox
Adobe Flash Player Plugin for Chrome
Adobe Flash Player Plugin for Safari
Adobe Flash Player ActiveX for IE
Using "object" Elements for Flash Files
Using "embed" Elements for Flash Files
"mp3player" - MP3 Music Player
What Is SWFObject?
Calling swfobject.embedSWF() Function
►embedSWF() Function and Arguments
Calling embedSWF() with "flashvars"
What is SWFObject HTML Code Generator?
Generating SWFObject HTML Code
Flash Player Projector
SWFTools - SWF File Manipulation Tools
SWFC Script to Generate Flash SWF Files
ActionScript Embedded in SWFC Script
AS3Compile - ActionScript 3 Compiler
Adobe Flex SDK 4
SWF File Structure and Tags
SWF File Processing Rules
SWF Files for Video and Audio Streams
Full Version in PDF/EPUB