tags:

views:

215

answers:

6
   <object height="25" width="75" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
     <param value="http://click-here-to-listen.com/players/iaPlay13.swf?x=1058286910FTRZGK" name="movie"/> 
     <param value="high" name="quality"/>
     <param value="#FFFFFF" name="bgcolor"/> 
     <param value="opaque" name="wmode"/>
     <embed height="25" width="75" wmode="opaque" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" bgcolor="#FFFFFF" quality="high" src="http://click-here-to-listen.com/players/iaPlay13.swf?x=1058286910FTRZGK"/&gt;
    </object>

I am having to insert this legacy markup into a new site that I'm building. Problem is its using an <embed> tag.

Would I just do away with the <embed> and put some content in as an alternative, for those that do not have flash? Basically I'm just trying to bring this piece of html into the 21st century.

+1  A: 

I use function AC_FL_RunContent for embedding flash objects - it's good because it supports all browsers and is recommended by Adobe.

More is here:

They also suggest using <object> tag instead of <embed>

pbrodka
+2  A: 

You can nest object elements to display alternatives. The W3C explains it here. I copied a snippet below:

One significant consequence of the OBJECT element's design is that it offers a mechanism for specifying alternate object renderings; each embedded OBJECT declaration may specify alternate content types. If a user agent cannot render the outermost OBJECT, it tries to render the contents, which may be another OBJECT element, etc.

In the following example, we embed several OBJECT declarations to illustrate how alternate renderings work. A user agent will attempt to render the first OBJECT element it can, in the following order: (1) an Earth applet written in the Python language, (2) an MPEG animation of the Earth, (3) a GIF image of the Earth, (4) alternate text.

<P>                 <!-- First, try the Python applet -->
<OBJECT title="The Earth as seen from space" 
    classid="http://www.observer.mars/TheEarth.py"&gt;
                <!-- Else, try the MPEG video -->
    <OBJECT data="TheEarth.mpeg" type="application/mpeg">
                <!-- Else, try the GIF image -->
      <OBJECT data="TheEarth.gif" type="image/gif">
                <!-- Else render the text -->
       The <STRONG>Earth</STRONG> as seen from space.
     </OBJECT>
   </OBJECT>
</OBJECT>
Vincent Ramdhanie
+1  A: 

Basically, you should keep embed, because it is a fallback for some old browsers. It might hurt validation of page, but as long as you know why it is there, it is OK.

At least that's the way Adobe officially recommends: Macromedia Flash OBJECT and EMBED tag syntax

You are right to want to do code for XXIth century, but we have to deal with browser from previous millennium... :-)

PhiLho
Yeah, but what browser would that be you want to deal with by using the "embed" tag? As far as I know, even IE 6 can play flash movies in an "object" tag without "embed" quite fine. And that is probably one of the worst browsers one has to deal with nowadays ...
hangy
+1  A: 

I found this code on the web (from a usability site) which caters for IE and others, and I use it on my flash pages (I've changed it to your code):

<!--[if !IE]> -->
<object type="application/x-shockwave-flash" data="http://click-here-to-listen.com/players/iaPlay13.swf?x=1058286910FTRZGK" width="75" height="25">
<!-- <![endif]-->

<!--[if IE]>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="75" height="25">
  <param name="movie" value="http://click-here-to-listen.com/players/iaPlay13.swf?x=1058286910FTRZGK" />
<!--><!--dgx-->
  <param name="loop" value="false">
  <param name="menu" value="false">
  <param name="quality" value="high">
</object>
<!-- <![endif]-->
Raithlin
+1  A: 

Here is an article that provides a clean and valid HTML that you can use. It uses a container movie to get around a streaming issue but otherwise offers what you are looking for with cleaner HTML.

http://www.alistapart.com/articles/flashsatay

jeremyasnyder
+2  A: 

I recommend that you use swfobject which is a cross platform, open source library to display flash on your pages.

http://code.google.com/p/swfobject/

There are a variety of ways to load the flash and the alternative (non-flash) content. For example the following code could replace your code:

<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
    swfobject.embedSWF("http://click-here-to-listen.com/players/iaPlay13.swf?x=1058286910FTRZGK", 
        "myContent", "25", "75", "9.0.0");
</script>
<div id="myContent">
  <p>Alternative content</p>
</div>
Keltex