SWFObject

Last updated
SWFObject 2
Developer(s) Geoff Stearns with Bobby van der Sluis, Aran Rhee, Kyle Simpson and Philip Hutchison
Initial releaseJanuary 2006
Final release
2.2 / June 12, 2009;14 years ago (2009-06-12)
Repository
Written in JavaScript
Platform Web browser
Size 10 KB (output JS file)
Available in English
Type 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, [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]

Contents

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 Ask.com, Windows.com, Time.com, Skype.com, Discovery.com and YouTube. [6]

Usage

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 <object> 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.

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, [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]

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. [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

Related Research Articles

<span class="mw-page-title-main">JavaScript</span> High-level programming language

JavaScript, often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of websites use JavaScript on the client side for webpage behavior, often incorporating third-party libraries. All major web browsers have a dedicated JavaScript engine to execute the code on users' devices.

<span class="mw-page-title-main">Adobe Flash</span> Deprecated multimedia platform used to add animation and interactivity to websites

Adobe Flash is a multimedia software platform used for production of animations, rich internet applications, desktop applications, mobile apps, mobile games, and embedded web browser video players.

<span class="mw-page-title-main">Adobe ColdFusion</span> Rapid Web app development platform

Adobe ColdFusion is a commercial rapid web-application development computing platform created by J. J. Allaire in 1995. ColdFusion was originally designed to make it easier to connect simple HTML pages to a database. By version 2 (1996) it had become a full platform that included an IDE in addition to a full scripting language.

SWF is an Adobe Flash file format used for multimedia, vector graphics and ActionScript. Originating with FutureWave Software, then transferred to Macromedia, and then coming under the control of Adobe, SWF files can contain animations or applets of varying degrees of interactivity and function. They may also occur in programs, commonly browser games, using ActionScript.

WebKit is a browser engine developed by Apple and primarily used in its Safari web browser, as well as all web browsers on iOS and iPadOS. WebKit is also used by the PlayStation consoles beginning from the PS3, the Tizen mobile operating systems, the Amazon Kindle e-book reader, Nintendo consoles beginning from the 3DS Internet Browser, and the discontinued BlackBerry Browser. WebKit's C++ application programming interface (API) provides a set of classes to display Web content in windows, and implements browser features such as following links when clicked by the user, managing a back-forward list, and managing a history of pages recently visited.

This is a comparison of both historical and current web browsers based on developer, engine, platform(s), releases, license, and cost.

Netscape Plugin Application Programming Interface (NPAPI) was an application programming interface (API) of the web browsers that allows plugins to be integrated.

Adobe Flash Player is computer software for viewing multimedia contents, executing rich Internet applications, and streaming audio and video content created on the Adobe Flash platform. It can run from a web browser as a browser plug-in or independently on supported devices. Originally created by FutureWave under the name FutureSplash Player, it was renamed to Macromedia Flash Player after Macromedia acquired FutureWave in 1996. It was then developed and distributed by Adobe Systems as Flash Player after Adobe acquired Macromedia in 2005. It is currently developed and distributed by Zhongcheng for users in China, and by Harman International for enterprise users outside of China, in collaboration with Adobe.

<span class="mw-page-title-main">Dojo Toolkit</span> Open-source modular JavaScript library

Dojo Toolkit is an open-source modular JavaScript library designed to ease the rapid development of cross-platform, JavaScript/Ajax-based applications and web sites. It was started by Alex Russell, Dylan Schiemann, David Schontzler, and others in 2004 and is dual-licensed under the modified BSD license or the Academic Free License.

<span class="mw-page-title-main">Adobe AIR</span> Cross-platform runtime system for building rich web applications

Adobe AIR is a cross-platform runtime system currently developed by Harman International, in collaboration with Adobe Inc., for building desktop applications and mobile applications, programmed using Adobe Animate, ActionScript, and optionally Apache Flex. It was originally released in 2008. The runtime supports installable applications on Windows, macOS, and mobile operating systems, including Android, iOS, and BlackBerry Tablet OS.

iMacros Browser-based application for macro recording, editing and playback

iMacros is a browser-based application for macro recording, editing and playback for web automation and testing. It is provided as a standalone application and extension for Mozilla Firefox, Google Chrome, and Internet Explorer web browsers. Developed by iOpus/Ipswitch, It adds record and replay functionality similar to that found in web testing and form filler software. The macros can be combined and controlled via JavaScript. Demo macros and JavaScript code examples are included with the software. Running strictly JavaScript-based macros was removed in later versions of iMacros browser extensions. However, users can use alternative browser like Pale Moon, based on older versions of Mozilla Firefox to use JavaScript files for web-based automated testing with Moon Tester Tool.

A single-page application (SPA) is a web application or website that interacts with the user by dynamically rewriting the current web page with new data from the web server, instead of the default method of a web browser loading entire new pages. The goal is faster transitions that make the website feel more like a native app.

Apache Cordova is a mobile application development framework created by Nitobi. Adobe Systems purchased Nitobi in 2011, rebranded it as PhoneGap, and later released an open-source version of the software called Apache Cordova. Apache Cordova enables software programmers to build hybrid web applications for mobile devices using CSS3, HTML5, and JavaScript, instead of relying on platform-specific APIs like those in Android, iOS, or Windows Phone. It enables the wrapping up of CSS, HTML, and JavaScript code depending on the platform of the device. It extends the features of HTML and JavaScript to work with the device. The resulting applications are hybrid, meaning that they are neither truly native mobile application nor purely Web-based. They are not native because all layout rendering is done via Web views instead of the platform's native UI framework. They are not Web apps because they are packaged as apps for distribution and have access to native device APIs. Mixing native and hybrid code snippets has been possible since version 1.9.

<span class="mw-page-title-main">Away3D</span>

Away3D is an open-source platform for developing interactive 3D graphics for video games and applications, in Adobe Flash or HTML5. The platform consists of a 3D world editor, a 3D graphics engine, a 3D physics engine and a compressed 3D model file format (AWD).

Modern HTML5 has feature-parity with the now-obsolete Adobe Flash. Both include features for playing audio and video within web pages. Flash was specifically built to integrate vector graphics and light games in a web page, features that HTML5 also supports.

In web development, a polyfill is code that implements a feature on web browsers that do not natively support the feature. Most often, it refers to a JavaScript library that implements an HTML5 or CSS web standard, either an established standard on older browsers, or a proposed standard on existing browsers. Formally, "a polyfill is a shim for a browser API."

<span class="mw-page-title-main">Chromium Embedded Framework</span> Free and open-source software framework

The Chromium Embedded Framework (CEF) is an open-source software framework for embedding a Chromium web browser within another application. This enables developers to add web browsing functionality to their application, as well as the ability to use HTML, CSS, and JavaScript to create the application's user interface.

<span class="mw-page-title-main">Brackets (text editor)</span> Editor for web development

Brackets is a source code editor with a primary focus on web development. Created by Adobe Inc., it is free and open-source software licensed under the MIT License, and is currently maintained on GitHub by open-source developers. It is written in JavaScript, HTML and CSS. Brackets is cross-platform, available for macOS, Windows, and most Linux distributions. The main purpose of Brackets is its live HTML, CSS and JavaScript editing functionality.

Google Chrome Experiments Online showroom of web browser based experiments

Google Chrome Experiments is an online showroom of web browser based experiments, interactive programs, and artistic projects. Launched on March 1, 2009, Google Chrome Experiments is an official Google website that was originally meant to test the limits of JavaScript and the Google Chrome browser's performance and abilities. As the project progressed, it took the role of showcasing and experimenting latest open-source web-based technologies, such as JavaScript, HTML5, WebGL, Canvas, SVG, CSS, and some others. All the projects on Chrome experiments are user submitted and are made using open source technologies. As of February 24, 2015, there were 1,000 different Chrome projects posted on the website.

Google APIs are application programming interfaces (APIs) developed by Google which allow communication with Google Services and their integration to other services. Examples of these include Search, Gmail, Translate or Google Maps. Third-party apps can use these APIs to take advantage of or extend the functionality of the existing services.

References

  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
SWFObject 1.5
SWFObject 2
General