Accessibility

Flash Article

 

JavaScript Flash Player Detection and Embedding with SWFObject


Geoff Stearns

Geoff Stearns

blog.deconcept.com

Table of Contents

Created:
8 May 2006
User Level:
Intermediate

SWFObject is a small JavaScript file that you can use for embedding Macromedia Flash content into your website. The script detects Flash Player in all major web browsers (Mac OS and Windows) and is designed to make embedding SWF files as easy as possible.

Besides being very search engine–friendly, SWFObject degrades gracefully, can be used in valid HTML and XHTML 1.0 documents (that is, when pages are sent as text/html instead of application/xhtml+xml), and is forward-compatible. It should work for years to come.

Requirements

In order to make the most of this article, you need the following software and files:

Flash 8

Any text editor


Sample files:

Prerequisite Knowledge

You should have a basic understanding of JavaScript and HTML.

About the author

Geoff Stearns lives in New York City where he works as a Flash and client-side developer at Schematic and runs a blog at blog.deconcept.com. He has been using Macromedia Flash since version 4 and building websites since 1996. He also teaches about XHTML, CSS, and Flash at The Cooper Union in New York.