SWFObject

SWFObject is an easy-to-use and standards-friendly method to embed Flash content, which utilizes one small JavaScript file. The actual version of the open-source project is 2.2. The work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. The authors of SWFObject are Geoff Stearns, late Michael Williams and Bobby van der Sluis.

SWFObject offers:

  • two optimized Flash Player embed methods; a markup based approach and a method that relies on JavaScript
  • a JavaScript API that aims to provide a complete tool set for embedding SWF files and retrieving Flash Player related information
  • only one small JavaScript file (10Kb / GZIPed: 3.9Kb)
  • replacement of SWFObject 1.5, UFO and the Adobe Flash Player Detection Kit
  • unification of all existing Flash Player embed methods and provision of a new standard for embedding Adobe Flash Player content
  • detection of the Flash Player version and determination whether Flash content or alternative content should be shown, to avoid that outdated Flash plug-ins break Flash content
  • functionality to revert to alternative content in case of an outdated plug-in by means of a DOM manipulation (Note: if no Flash plug-in is installed the HTML object element automatically falls back to its nested alternative content)
  • the option to use Adobe Express Install to download the latest Flash Player

SWFObject 2 offers two distinct methods to embed Flash Player content:

1. The static publishing method embeds both Flash content and alternative content using standards compliant markup, and uses JavaScript to resolve the issues that markup alone cannot solve
2. The dynamic publishing method is based on marked up alternative content and uses JavaScript to replace this content with Flash content if the minimal Flash Player version is installed and enough JavaScript support is available.

Both methods have advantages. The SWFObject library consists of one external JavaScript file. SWFObject will be executed as soon as it is read and will perform all DOM manipulations as soon as the DOM is loaded – for all browsers that support this, like IE, Firefox, Safari and Opera 9+ – or otherwise as soon as the onload event fires.

An online HTML and javascript generator is provided to create the right code for an swf object. A tutorial how to use SWFObject is available on the Adobe website. The following link leads to a webpage with a script indicating the installed Flash version.