SWFObject
   HOME

TheInfoList



OR:

SWFObject (originally FlashObject) is an unmaintained
open-source Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use and view the source code, design documents, or content of the product. The open source model is a decentrali ...
JavaScript JavaScript (), often abbreviated as JS, is a programming language and core technology of the World Wide Web, alongside HTML and CSS. Ninety-nine percent of websites use JavaScript on the client side for webpage behavior. Web browsers have ...
library A library is a collection of Book, books, and possibly other Document, materials and Media (communication), media, that is accessible for use by its members and members of allied institutions. Libraries provide physical (hard copies) or electron ...
used to embed
Adobe Flash Adobe Flash (formerly Macromedia Flash and FutureSplash) is a mostly discontinuedAlthough it is discontinued by Adobe Inc., for the Chinese market it is developed by Zhongcheng and for the international enterprise market it is developed by Ha ...
content onto
Web page A web page (or webpage) is a World Wide Web, Web document that is accessed in a web browser. A website typically consists of many web pages hyperlink, linked together under a common domain name. The term "web page" is therefore a metaphor of pap ...
s and to protect the
flash game A browser game is a video game that is played on the internet using a web browser. They are sometimes referred to more specifically by their format, such as Flash games or HTML5 games. They are generally free-to-play and can be either single-play ...
against piracy, which is supplied as one small JavaScript file. The library can also detect the installed
Adobe Flash Player Adobe Flash Player (known in Internet Explorer, Firefox, and Google Chrome as Shockwave Flash) is a discontinuedExcept in China, where it continues to be used, as well as Harman for enterprise users. computer program for viewing multimedia ...
plug-in in all major
web browsers A web browser, often shortened to browser, is an application for accessing websites. When a user requests a web page from a particular website, the browser retrieves its files from a web server and then displays the page on the user's scree ...
, on all major operating systems (OS), and can redirect the visitor to another webpage or show alternate
HTML Hypertext Markup Language (HTML) is the standard markup language for documents designed to be displayed in a web browser. It defines the content and structure of web content. It is often assisted by technologies such as Cascading Style Sheets ( ...
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 In the context of the World Wide Web, deep linking is the use of a hyperlink that links to a specific, generally searchable or indexed, piece of web content on a website (e.g. "https://example.com/path/page"), rather than the website's home page ...
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 Ask.com (known originally as Ask Jeeves) is an answer engine, e-magazine, and former web search engine, operated by Ask Media Group. It was conceptualized and developed in 1996 by Garrett Gruener and David Warthen (based in Berkeley, Califo ...
, Windows.com,
Time.com ''Time'' (stylized in all caps as ''TIME'') is an American news magazine based in New York City. It was published weekly for nearly a century. Starting in March 2020, it transitioned to every other week. It was first published in New York Cit ...
, Skype.com, Discovery.com and
YouTube YouTube is an American social media and online video sharing platform owned by Google. YouTube was founded on February 14, 2005, by Steve Chen, Chad Hurley, and Jawed Karim who were three former employees of PayPal. Headquartered in ...
.


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 Web design encompasses many different skills and disciplines in the production and maintenance of websites. The different areas of web design include web graphic design; user interface design (UI design); authoring, including standardised code an ...
. 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 Adobe Flash Player (known in Internet Explorer, Firefox, and Google Chrome as Shockwave Flash) is a discontinuedExcept in China, where it continues to be used, as well as Harman for enterprise users. computer program for viewing multimedia c ...
), such as the
Wii The Wii ( ) is a home video game console developed and marketed by Nintendo. It was released on November 19, 2006, in North America, and in December 2006 for most other regions of the world. It is Nintendo's fifth major home game console, f ...
,
PlayStation 3 The PlayStation 3 (PS3) is a home video game console developed and marketed by Sony Computer Entertainment (SCE). It is the successor to the PlayStation 2, and both are part of the PlayStation brand of consoles. The PS3 was first released on ...
and
Nokia N800 The Nokia N800 Internet tablet is a wireless Internet appliance from Nokia, originally announced at the Las Vegas CES 2007 Summit in January 2007. N800 allows the user to browse the Internet and communicate using Wi-Fi networks or with mobi ...
, unlike the
PlayStation Portable The PlayStation Portable (PSP) is a handheld game console developed and marketed by Sony Interactive Entertainment, Sony Computer Entertainment. It was first released in Japan on December 12, 2004, in North America on March 24, 2005, and in PA ...
. 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 Dynamic HTML, or DHTML, is a term which was used by some browser vendors to describe the combination of HTML, style sheets and client-side scripts (JavaScript, VBScript, or any other supported scripts) that enabled the creation of interactiv ...
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 A prototype is an early sample, model, or release of a product built to test a concept or process. It is a term used in a variety of contexts, including semantics, design, electronics, and Software prototyping, software programming. A 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 In the context of the World Wide Web, deep linking is the use of a hyperlink that links to a specific, generally searchable or indexed, piece of web content on a website (e.g. "https://example.com/path/page"), rather than the website's home page ...
, and can automatically integrate with SWFObject.


SWFFit

SWFFit (formerly known as ''FitFlash'') is a
JavaScript library A JavaScript library is a library of pre-written JavaScript code that allows for easier development of JavaScript-based applications, especially for AJAX and other web-centric technologies. They can be included in a website by embedding it directl ...
used to resize Flash movies according to the browser window size, keeping it accessible independent of the screen resolution.SWFFit
Google Code 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

*
Adobe Flash Adobe Flash (formerly Macromedia Flash and FutureSplash) is a mostly discontinuedAlthough it is discontinued by Adobe Inc., for the Chinese market it is developed by Zhongcheng and for the international enterprise market it is developed by Ha ...
*
Adobe Flash Player Adobe Flash Player (known in Internet Explorer, Firefox, and Google Chrome as Shockwave Flash) is a discontinuedExcept in China, where it continues to be used, as well as Harman for enterprise users. computer program for viewing multimedia ...
* SWF *
JavaScript JavaScript (), often abbreviated as JS, is a programming language and core technology of the World Wide Web, alongside HTML and CSS. Ninety-nine percent of websites use JavaScript on the client side for webpage behavior. Web browsers have ...


References


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 ;General
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 {{Adobe Flash Adobe Flash Software using the MIT license