World Library  
Flag as Inappropriate
Email this Article


Article Id: WHEBN0021027307
Reproduction Date:

Title: SWFObject  
Author: World Heritage Encyclopedia
Language: English
Subject: SWFAddress, Adobe Flash, List of JavaScript libraries, ActionScript, List of Adobe Flash software
Collection: Adobe Flash, Software Using the Mit License
Publisher: World Heritage Encyclopedia


SWFObject 2
Developer(s) Geoff Stearns with Bobby van der Sluis, Aran Rhee, Kyle Simpson and Philip Hutchison
Initial release January 2006
Stable release 2.2 / June 12, 2009 (2009-06-12)
Development status Stable
Written in JavaScript
Platform Web browser
Size 10 KB (output JS file)
Available in English
Type JavaScript library
License MIT License

SWFObject (originally FlashObject) is an open-source JavaScript library used to embed Adobe Flash content onto Web pages,[1] which is supplied as one small JavaScript file.[2][3] 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.[4]

The library is independent, although related external libraries often integrate with it, such as SWFAddress for deep linking and SWFFit for dynamic content scaling.

With the multitude of Flash embedding JavaScript libraries, SWFObject has emerged as the most popular being used by over 2,600,000 websites as of 2011,[5] including high-profile websites such as,,,, and YouTube.[6]


  • Usage 1
  • Features 2
  • Plugins 3
    • SWFAddress 3.1
    • SWFFit 3.2
  • See also 4
  • References 5
  • External links 6


SWFObject provides a reliable method of embedding Flash content into a webpage[7][8] 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.[9] 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).[10] 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.[11]

A disadvantage with SWFObject is that visitors with JavaScript disabled in their web browsers will not be able to view the Flash content,[12] and will instead see alternate HTML content provided by the web page.[13] 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 tags for the best browser compatibility[14]), and using the registerObject() function within the library's API[15] 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,[16][17] and a few DHTML utilities to help work with the DOM.[18] 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 this requires a browser restart.[19]



SWFAddress is a JavaScript and ActionScript library that allows Flash websites to support deep linking, and can automatically integrate with SWFObject.


SWFFit (formerly known as FitFlash) is a JavaScript library used to resize Flash movies according to the browser window size, keeping it accessible independent of the screen resolution.[20][21][22][23] SWFFit primarily configures the web browser to display scroll bars when content exceeds the browser window size. It can also be used to dynamically resize the Flash movie size. It is used together with SWFObject.

See also


  1. ^ Todd Perkins, Search Engine Optimization for Flash, O'Reilly Media, 2009, p. 87
  2. ^ Yakov Fain, Victor Rasputnis, Anatole Tartakovsky, Enterprise Development with Flex, O'Reilly Media, Inc., 2010, p. 183
  3. ^ Source Checkout, swfobject - Google Code, Page Header, overview of SWFObject
  4. ^ SWFObject 1.5 Homepage, deconcept
  5. ^ SWFObject Usage Statistics, BuiltWith
  6. ^ Who uses SWFObject?, SWFObject FAQ
  7. ^ Adobe Developer Network
  8. ^ Roger Braunstein, ActionScript 3.0 Bible, John Wiley and Sons, 2010, p. 898
  9. ^ Embedding Adobe Flash Player content using SWFObject 2 - Documentation - Google Code
  10. ^ Ben Henick, HTML & CSS: The Good Parts, O'Reilly Media, Inc., 2009, p. 195
  11. ^ Do SWFs embedded with SWFObject 2 display in the Sony PS3 or Nintendo Wii web browsers?, SWFObject FAQ
  12. ^ Chafic Kazoun, Joey Lott, Programming Flex 3, O'Reilly Media, Inc., 2008, p. 524
  13. ^ Eric Enge, Stephan Spencer, Rand Fishkin, Jessie C. Stricchiola, The Art of SEO, O'Reilly Media, Inc., 2009, p. 273
  14. ^ Bobby van der Sluis > Flash embed test suite, HTML embed element compatibility
  15. ^ Function swfobject.registerObject, SWFObject JavaScript API documentation - Google Code
  16. ^ Robert Reinhardt, Snow Dowd, Flash CS4 Professional Bible, John Wiley and Sons, 2009
  17. ^ Function swfobject.hasFlashPlayerVersion, SWFObject JavaScript API documentation - Google Code
  18. ^ Function swfobject.add(Dom)LoadEvent, SWFObject JavaScript API documentation - Google Code
  19. ^ SWFObject 2.2 - What's new?, Google Code
  20. ^ swffit: Smart Flash Resize Script, Web Resource Depot
  21. ^ Roger Braunstein, ActionScript 3.0 Bible, John Wiley and Sons, p. 898
  22. ^ SWFFit website
  23. ^ SWFFit, Google Code

External links

SWFObject 1.5
  • SWFObject 1.5 Homepage, deconcept, overview and usage of an older version of SWFObject
  • SWFObject 1.5 released, deconcept Blog
SWFObject 2
  • swfobject 2, Google Code, freely download SWFObject for usage on a website
  • SWFObject 2 FAQ
  • SWFObject Documentation, Google Code, the What, Why and How, of SWFObject 2
  • Methods of embedding Flash onto a webpage, internally used by SWFObject to maximize compatibility.
  • Embed Multiple Web FLV Players in One Web page, using SWFObject or Flashvars code
  • Flash Embedding Cage Match, A List Apart, compares the Flash embedding methods.
  • swfobject.js vs Embed HTML, advantages of SWFObject over traditional HTML tags
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.