Embedding Swf in HTML with Valid w3 validation

Discussion in 'HTML & Website Design' started by GAdsense, Jul 6, 2008.

  1. #1
    I need help in how to embed any swf file in html, without getting any validation errors on w3 validator.

    I am using the following code, which works fine. But it does not validate as XHTML 1.0 Transitional.

    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="300" height="200" id="xml_demo" align="middle">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="movie" value="xml_demo.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />
    <embed src="xml_demo.swf" width="500" height="400"></embed>
    </object>
    Code (markup):
    Please help.
     
    GAdsense, Jul 6, 2008 IP
  2. GAdsense

    GAdsense Well-Known Member

    Messages:
    1,247
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    140
    #2
    The error is basically because of embed tag, it is not validating because of that, why so?
     
    GAdsense, Jul 6, 2008 IP
  3. GAdsense

    GAdsense Well-Known Member

    Messages:
    1,247
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    140
    #3
    Okay, I cracked the code.

    The following code works fine, with this, it validates valid as well.

    <object type="application/x-shockwave-flash" data="xml_demo.swf" width="600" height="400">
    <param name="movie" value="xml_demo.swf" />
    <param name="BGCOLOR" value="#CFDAE4" />
    <a title="You must install the Flash Plugin for your Browser in order to view this movie"  href="http://www.macromedia.com/shockwave/download/alternates/"><img src="needplugin.gif" width="431" height="68"  alt="placeholder for flash movie" /></a>
    </object>
    Code (markup):
     
    GAdsense, Jul 6, 2008 IP