From Surf Wiki (app.surf) — the open knowledge base
SWFObject
Free JavaScript library for Flash content
Free JavaScript library for Flash content
| Field | Value |
|---|---|
| name | SWFObject 2 |
| logo | Swfobject logo.gif |
| logo size | 200px |
| developer | [Geoff Stearns](http://www.geoffstearns.com/) with [Bobby van der Sluis](http://www.bobbyvandersluis.com/), [Aran Rhee](http://www.misterhee.com/), [Kyle Simpson](http://getify.com/) and [Philip Hutchison](http://pipwerks.com/) |
| released | January 2006 |
| latest release version | 2.2 |
| latest release date | |
| programming language | JavaScript |
| platform | Web browser |
| size | 10 KB (output JS file) |
| language | English |
| discontinued | yes |
| genre | JavaScript library |
| license | MIT License |
| website | https://github.com/swfobject/swfobject |
SWFObject (originally FlashObject) is an unmaintained open-source JavaScript library used to embed Adobe Flash content onto Web pages and to protect the flash game against piracy, which is supplied as one small JavaScript file. 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.
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, including high-profile websites such as Ask.com, Windows.com, Time.com, Skype.com, Discovery.com and YouTube.
Usage
SWFObject provides a reliable method of embedding Flash content into a webpage 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. 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). 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.
A disadvantage with SWFObject 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 tags for the best browser compatibility), and using the registerObject() function within the library's API to register the Flash content enabling usage of the other features that the library provides.
Features
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, and a few DHTML utilities to help work with the DOM. 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.
Plugins
SWFAddress
SWFAddress is a JavaScript and ActionScript library that allows Flash websites to support deep linking, and can automatically integrate with SWFObject.
SWFFit
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. 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.
References
References
- Todd Perkins, [https://books.google.com/books?id=OLlh6tYz8CcC&dq=swfobject&pg=PA87 Search Engine Optimization for Flash], O'Reilly Media, 2009, p. 87
- Yakov Fain, Victor Rasputnis, Anatole Tartakovsky, [https://books.google.com/books?id=kjCaK4jXOJEC&dq=swfobject&pg=PA183 Enterprise Development with Flex], O'Reilly Media, Inc., 2010, p. 183
- [https://code.google.com/p/swfobject/source/checkout Source Checkout, swfobject - Google Code], Page Header, overview of SWFObject
- [http://blog.deconcept.com/swfobject/ SWFObject 1.5 Homepage], deconcept
- [http://trends.builtwith.com/javascript/SWFObject SWFObject Usage Statistics], BuiltWith
- [http://blog.deconcept.com/swfobject/#faq Who uses SWFObject?], SWFObject FAQ
- [https://www.adobe.com/devnet/flashplayer/articles/swfobject.html Adobe Developer Network]
- Roger Braunstein, [https://books.google.com/books?id=SstX7mlHLckC&dq=swfobject&pg=PA898 ActionScript 3.0 Bible], John Wiley and Sons, 2010, p. 898
- [https://code.google.com/p/swfobject/wiki/documentation Embedding Adobe Flash Player content using SWFObject 2 - Documentation - Google Code]
- Ben Henick, [https://books.google.com/books?id=gkBLI3xHYMUC&dq=swfobject&pg=PA195 HTML & CSS: The Good Parts], O'Reilly Media, Inc., 2009, p. 195
- [https://code.google.com/p/swfobject/wiki/faq#12._Do_SWFs_embedded_with_SWFObject_2_display_in_the_Sony_PS3_or Do SWFs embedded with SWFObject 2 display in the Sony PS3 or Nintendo Wii web browsers?], SWFObject FAQ
- Chafic Kazoun, Joey Lott, [https://books.google.com/books?id=Rkm8vNoqlv8C&dq=swfobject&pg=PA524 Programming Flex 3], O'Reilly Media, Inc., 2008, p. 524
- Eric Enge, [[Stephan Spencer]], Rand Fishkin, [[Jessie C. Stricchiola]], [https://books.google.com/books?id=4VvOLL4KIesC&dq=swfobject&pg=PA273 The Art of SEO], O'Reilly Media, Inc., 2009, p. 273
- [http://www.bobbyvandersluis.com/flashembed/testsuite/ Bobby van der Sluis > Flash embed test suite], HTML embed element compatibility
- [https://code.google.com/p/swfobject/wiki/api#SWFObject_API_documentation Function swfobject.registerObject, SWFObject JavaScript API documentation - Google Code]
- Robert Reinhardt, Snow Dowd, [https://books.google.com/books?id=hQo5wnfShDUC&dq=swfobject&pg=PT590 Flash CS4 Professional Bible], John Wiley and Sons, 2009
- [https://code.google.com/p/swfobject/wiki/api#swfobject.hasFlashPlayerVersion(versionStr) Function swfobject.hasFlashPlayerVersion, SWFObject JavaScript API documentation - Google Code]
- [https://code.google.com/p/swfobject/wiki/api#swfobject.addLoadEvent(fn) Function swfobject.add(Dom)LoadEvent, SWFObject JavaScript API documentation - Google Code]
- [https://code.google.com/p/swfobject/wiki/whats_new SWFObject 2.2 - What's new?], Google Code
- [http://www.webresourcesdepot.com/swffit-smart-flash-resize-script/ swffit: Smart Flash Resize Script], Web Resource Depot
- Roger Braunstein, [https://books.google.com/books?id=SstX7mlHLckC&dq=swffit&pg=PA898 ActionScript 3.0 Bible], John Wiley and Sons, p. 898
- [http://swffit.millermedeiros.com/ SWFFit website]
- [https://code.google.com/p/swffit/ SWFFit], Google Code
This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page.
Ask Mako anything about SWFObject — get instant answers, deeper analysis, and related topics.
Research with MakoFree with your Surf account
Create a free account to save articles, ask Mako questions, and organize your research.
Sign up freeThis content may have been generated or modified by AI. CloudSurf Software LLC is not responsible for the accuracy, completeness, or reliability of AI-generated content. Always verify important information from primary sources.
Report