Will Fris's WordPress Weblog

{20080908}   Embedding flash objects

I have adapted hixie‘s solution to embed flash movies.
Although Roberto Scano‘s method seems to be the same, it is somewhat different.
In the browser on my platform Roberto’s method shows me two alternative messages, which I find excessive.
I also came across Jason Gill‘s method, a version quite like hixie’s though not hixie’s, Jason says.

I like Hixie and Gill their approaches. What I do not understand though, is
why they do not use the conditonal comments to provide one fallback to all browsers.
Maybe it is because of the fact that my solution does not work… : )
But I cannot test this at the moment.
(and probably never can test it in many different browsers on different platforms)

Anyways, the code:

<!--[if IE]>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="300" height="120">
    <param name="movie" value="http://www.macromedia.com/shockwave/download/triggerpages_mmcom/flash.swf"/>
    <param name="quality" value="high"/>
    <param name="bgcolor" value="#FFFFFF"/>
<!--> <![endif]-->
<!--[if !IE]> <-->
<object data=”http://www.macromedia.com/shockwave/download/triggerpages_mmcom/flash.swf” width=”300″ height=”120″ type=”application/x-shockwave-flash”>
    <param name=”quality” value=”high”/>
    <param name=”bgcolor” value=”#FFFFFF”/>
    <param name=”pluginurl” value=”http://www.macromedia.com/go/getflashplayer”/>
<!--> <![endif]-->
    FAIL (the browser should render some flash content, not this).

Ofcourse you can leave out parameter-stuff like quality and bgcolor…

If you’d like to read more about this subject, I would like to recommend you to read Joe Clark‘s article on the subject.

And if you’re extremely fond of JavaScript, you might like to take a look at the SWFObject.

It takes quite some variables into account, like:
detecting the version of flash that is available
being able to server flash9 movies to flash9-clients only for instance
excluding the need for `click to activate`-action on the flash-movie for the end-user(a.k.a. client)
providing a platform to whine and moan about what’s bothering you with this plugin(a.k.a. having quite some people using it)
it’s documented and maintained quite well for as far as I can see

And as for testing my try at at the embedding,
I would like to hear from you if something goes wrong,
though it is also nice to hear that all goes well of course…

!update 2008/09/10 22:56 GMT+1
Changed the code a little bit. (It will now serve `different` content to IE then to all non-IE browsers)
And added comment that parameters can be left out.


Where did you get your blog layout from? I’d like to get one like it for my blog.

rscano says:

Hi, can u explain where my method show two messages?

willfris says:

Yes, it does so on my set-up.

Linux (Ubuntu) and Firefox 3.0.1 with noscript-addon.

And what also is weird is that with flash enabled it still gives me the two altenative messages.

sandrar says:

Hi! I was surfing and found your blog post… nice! I love your blog. 🙂 Cheers! Sandra. R.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

et cetera
%d bloggers like this: