From Seo Wiki - Search Engine Optimization and Programming Languages

Jump to: navigation, search
SWFObject 2
File:Swfobject logo.gif
Developer(s) Geoff Stearns with Toby Boudreaux and Bobby van der Sluis
Initial release January 2006
Stable release 2.2 / June 12, 2009; 147656007 ago
Written in JavaScript
Platform Web browser
Size 10 KB (output JS file)
Available in English
Development status Stable
Type JavaScript library
License MIT License
Website http://code.google.com/p/swfobject/

SWFObject (originally FlashObject[1]) is an open-source JavaScript library used to embed Adobe Flash content onto Web pages, which is supplied as one small JavaScript file.[2] The library can also detect the installed Adobe Flash Player plug-in in all major web browsers, on all major operating systems (OS), and can redirect the visitor to another webpage or show alternate HTML content if the installed plug-in is not suitable.[3] The library is independent, although related external libraries often integrate with it, such as SWFAddress and SWFFit.

SWFObject is used by over 12% of the websites detected to be utilizing any form of JavaScript[4], amounting to thousands of modern websites such as Ask.com, Windows.com, Time.com, Skype.com, Discovery.com and YouTube.[5][6]



SWFObject provides the most reliable method of embedding Flash content into a webpage[citation needed], by internally handling the various practices that one must follow in order for different web browsers to display Flash content correctly, and isolating them from the web designer. The developer may interface with the library in a standardized manner, the minimum being a single line of JavaScript code.[7] Therefore even inexperienced web designers without knowledge of the ideal HTML code to embed Flash content, can easily insert Flash content into web pages, and have them reliably work for the widest possible audience (excepting those with JavaScript disabled).[citation needed] Flash content inserted using SWFObject will also work on devices that support JavaScript execution (and Flash Player), such as the Wii, PlayStation 3 and Nokia N800, unlike the PlayStation Portable.[8]


The biggest disadvantage of relying on SWFObject to embed Flash content without using any compatible HTML markup, is that visitors with JavaScript disabled in their web browsers will not be able to view the Flash content, and will instead see alternate HTML content provided by the web page. For websites that aim to reach the widest possible audience an alternate method is available, by using standards-compliant HTML markup to embed the Flash movie (typically using the <object> tags for the best browser compatibility[9]), and using the registerObject() function within the library's API[10] to register the Flash content enabling usage of the other features that the library provides.


SWFObject also includes a few utility functions within its API to retrieve Flash Player related information, such as checking whether a specific version of Flash Player is installed,[11] and a few DHTML utilities to help work with the DOM.[12] Because of this, the most common reasons Flash Website developers turn to external JavaScript frameworks such as jQuery or Prototype are satisfied internally, giving developers fewer reasons to add additional JavaScript libraries to their website.

The library can also be used to integrate Flash Player Express Install into the webpage, allowing users to install the latest Flash Player without leaving the site, although requiring an automatic browser restart.[13]


See also

External links

SWFObject 1.5
SWFObject 2
Personal tools

Served in 0.274 secs.