Web standards compliant Javascript Flash detect and embed

SWFObject is a small Javascript file used for embedding Adobe Flash content. The script can detect the Flash plug-in in all major web browsers and is designed to make embedding Flash movies as easy as possible. It is also very search engine friendly, degrades gracefully, can be used in valid HTML and XHTML 1.0 documents*, and is forward compatible.

There was an uproar during late 2002 when alistapart came up with an article Flash Satay. Nonthless, few limitations came as a package deal and one need to hack around the same. During the days of the Eolas Patent, the workaround where Javascript was used to embed Flash, was indeed serving up a dual role to attain Web Standard compliancy. But then that the Patent is no more a worry, the tiresome work-around is thus better left alone.

Geoff Stearns wrote an article, Web standards compliant Javascript Flash detect and embed which then gave birth to the ultimate in Standard Compliant Flash Object/Embed, the SWFObject.


UPDATES

I think I will just add some more text to make things easier and able to just read this to understand the core requirement, functionalities. The method have the ability to detect the Flash player major version and thus decide either to display the “swf” or an alternate content; even better as it can be bypassed just in case user has Flash but the detect failed for some reason(s). The method have have the ability to include additional parameters and variables passed to the “swf” via the Flashvars.

To pass Flashvars

var myFlashObject = new FlashObject("flashvars.swf", "flashvarsID", "500", "300", 7, "#ffffff");
myFlashObject.addParam("flashvars", "&flashVarTxt=From FlashVars");
myFlashObject.write();

Another cool features was the ability to target a specific element to place the “swf” in by passing an element id in the write() method;
myFlashObject.write("mydiv");

Well, this will be even better when we want to have content at the top hierarchy of the html while keeping the “swf” container script away from the same. For instance, you can have an “swf” masthead but use the script at a lower hierarchy so that search engines will find the actual content first and our tags/scripts later.

2006 November 20 — With Geoff’s changes to the SWFObject, the article above may not really apply aptly. Please refer to the SWFObject Documentation for more details.


Don't like it? There are lots of published articles, pick a random one.

oCricket

Brajeshwar posted this article on Sat, Jan 15th, 2005 at 7:06 am
Categorized under Technology

Prev Article: Amu

Next Article: Virtual Stan


Possibly Related Articles

Archives: Visit the Archives for more articles.

Comments Post Yours

There are no response so far. You can follow any responses to this entry through the RSS feed. You can leave a response, or trackback from your own site.

Post yours

Sidenotes

Quick notes, scribbles, somehow related to this website and to what I do. Or perhaps I'm just plain lazy to make them into a full article.

Adobe releases Flash Player 10 (Mac, Win & Linux)

Adobe have released the shipping version of Flash Player 10 for Mac, Windows and Linux. More about Flash Player 10 * About Flash Player 10 * Get Flash Player 10 (Official Release version 10.0.12.36) * Download Debug and Standalone ...15th Oct, 2008

What a bad team can do to a Startup?

Flash/Flex developer, Orian Marx, started his Startup with much zeal and enthusiasm but had to give-in to failures because of none other but the team - the founders involved. His article outlined the story so ...13th Oct, 2008

Introduction to Adobe AIR (NetTuts)

Nettuts have a nice Introduction to Adobe AIR which focus on using HTML/JS to build an AIR Application. It covers -- Adobe AIR Architecture, How to install AIR, Get the development SDK, Configurations, gets on to ...2nd Oct, 2008

Decide Team Type from Books

What do you think of the "Team-Type" if they got these books recently? What "Team-Type" do these books suggest? ( surveys) 29th Sep, 2008

What do investors look for in a startup?

A great video Interview with Venture Hacker Naval Ravikant answering the age-old question: What do you look for in a startup? Investors look for two things that are paramount above all: # Great team: It's obvious. It's a ...27th Sep, 2008

View the Sidenotes Archive

Play the Penguin Game

Recommended

  • Downloads All downloads, Free and Open Source.
  • Ode to Apple Dedicated to Apple - Mac, iPhone, iPod, iTunes, Quicktime, Apple TV and all the awesome softwares for the Apple Mac.
  • Forum Oinam’s technical discussion forum where developers and designers can discuss all technical topics.
  • My Special Job My Special Job is a place where you can look for your weird necessities, strangely superb employees, when your need are more of those hackers, geeks, and ultimate rockstars in the Internet Technology.
  • ActionScript 3.0 Reference Flash/Flex ActionScript 3.0 Reference.
  • Not Safe for Work Ever clicked a link and felt embarrassed with the content in front of your co-workers? Ever caught unaware because the funny link your friend sent was a little beyond funny? Let’s minimize that with NSWF.
  • oCricket oCricket is about Cricket and people enthusiastic about it.

Download free Brajeshwar Wordpress Theme

Brajeshwar

Brajeshwar I firmly believe in keeping things simple, easy for users and I envison pushing the technical envelop time and again for the betterment of viable commercial and practical applications. More about me.

Brajeshwar Personal Identity Portal powered by VeriSign Labs

Brajeshwar's affinity with Adobe

My Photos

More photos on Flickr

Member of 9rules Network

Since its inception on 11th June, 2001, "Brajeshwar" has 865 Articles and 6,012 comments, contained within 20 categories and 1,234 tags.