Simple XHTML Flash Embedding

The typical way mot people embed flash is pure ugly. Not only is it ugly, but it breaks the XHTML standard. Luckily, there’s a way around it which is much better than the traditional way, and as an added bonus, has a built in flash plugin check without any javascript!

<object type="application/x-shockwave-flash" data="yourswf.swf" width="100" height="100">
    <param name="movie" value="yourswf.swf" />
    <img src="no-flash.png" width="100" height="100" alt="" />
</object>

The data in the object tag (beside the param tag) is only called if the flash plugin is not available. Meaning you can put any html you want there as an alternative. I’m sure if you play around with it you will find how much better this is.

4 Responses to “Simple XHTML Flash Embedding”

  1. Tix'z Says:

    And you don’t think this one is ogly?

    Try SWFObject instead!

  2. dawnerd Says:

    Yes, SWFObject is great. But I am showing you how to make flash embedding work in XHTML without javascript.

  3. dawnerd » Blog Archive » Making Flash Obey Z-Index Says:

    [...] will use the script I put together in the “Simple XHTML Flash Embedding [...]

  4. geetha Says:

    I think the Satay method is the ideal way of embedding Flash in xhtml pages.

Leave a Reply






Copyright 2008 Troy Whiteley & OjaiSoft

CSS | PHP | XHTML/HTML | JavaScript | Featured Sites

Home | Labs | License | RSS | Log in