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

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.

Great Indian Developer Summit 2009

I got a Press Release of the upcoming GIDS '09 and here is an excerpt. The summit's program covers Java, REST, Unit testing, Groovy, Spring, Struts 2.0, SOA, Cloud Computing, Web Services, JRuby, RoR, Ruby, JVM, ...21st Jan, 2009

The flourishing gun market in Pakistan

VICE Travel: Darra, Pakistanby Top-Notch112 (Via: Deep Green Crystals) 20th Jan, 2009

Angry Ringtone for iPhone and others

[audio:http://audio.brajeshwar.com/angry-ring-ring.mp3] The ANGRY RINGTONE for iPhone. (Click the PLAY button above!) Download * iPhone Ringtone (.m4r) * MP3 Ringtone (.mp3) * Zipped (both .m4r and .mp3) To use it as an iPhone Ringtone; just double click the file "angry-ring-ring.m4r" and it ...15th Jan, 2009

IIM Ahmedabad's Leverage 2009

Leverage, the Venture Capital and Private Equity Club of IIM Ahmedabad and the Centre for Innovation Incubation and Entrepreneurship bring to you the 1st edition of the Venture Capital and Private Equity Conference on the ...12th Jan, 2009

Fedora 10 Released

Let's talk history! Fedora was created in late 2003 as a Linux based Operating System which gives the users an admittance from anywhere in the world to the most up-to-date free and open source software ...28th Nov, 2008

View the Sidenotes Archive

Play the Penguin Game

Recommended

  • AS 2.0 Reference Reference for ActionScript 2.0 Programming Language used in Flash. Primarily stashed here for my own personal reference.
  • oCricket oCricket is about Cricket and people enthusiastic about it.
  • Ode to Apple Dedicated to Apple - Mac, iPhone, iPod, iTunes, Quicktime, Apple TV and all the awesome softwares for the Apple Mac.
  • 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.
  • 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.
  • Downloads All downloads, Free and Open Source.

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's affinity with Adobe

My Photos

More photos on Flickr

Member of 9rules Network

Since its inception on 11th June, 2001, "Brajeshwar" has 949 Articles and 6,472 comments, contained within 22 categories and 1,497 tags.