The Advantages of Using SWFObject to Embed Flash Files, Part One
What is SWFObject?
object that you embed into an HTML page. It was created by Georff Stearns, Michael Williams, and Bobby van der Sluis. Its goals are threefold: 1) replace the Adobe Flash Player Detection Kit; 2) unify existing embedding methods; and 3) create a new standard for embedding SWFs.
Advantages of Using SWFObject
Three big advantages are:
Manipulation: You can use the API to modify properties of the SWF, such as its location or size. Behavior such as SWF removal from a page when the user clicks a button or does a rollover with a mouse can be written quickly in a few lines.
Customization: You can write functions that change the behavior of a SWF as the web page loads, or easily pass parameters to the SWF from a URL.
To use SWFObject, obtain the JS code and the generator from the URL indicated in the resources section. For the generator, you’ll have the choice of using the Adobe Air version or the traditional manual HTML version. Create a directory, and place the JS script there. You also have the option of linking to a script on a Google server. Afterwards, use the generator to create the HTML embedding.
Where to Learn More
For a very good tutorial, it is recommended that you read and work through creator Bobby van der Sluis’ SWFObject 2 Tutorial.
In part two, we will look at an overview of the SWFObject 2 API.