SWFObject embedded in XHTML XForm

4 views
Skip to first unread message

dl

unread,
Nov 7, 2010, 11:49:58 AM11/7/10
to SWFObject
Can someone explain why this xhtml code (dropped into the standard
swfobject 2.2 folder)
does not render a flash object in Firefox? I've used SWFObject before
in HTML but want to embed SWFObject in an XForm.

<xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml">
<xhtml:head>
<meta name="content-object-type" content="application/x-shockwave-
flash" />
<xhtml:title>SWFObject 2 static publishing example page</xhtml:title>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
swfobject.registerObject("myId", "9.0.0", "expressInstall.swf");
</script>
</xhtml:head>
<xhtml:body>
<xhtml:p>Hello World!</xhtml:p>
<xhtml:div>
<object id="myId" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
width="300" height="120">
<param name="movie" value="test.swf" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="test.swf"
width="300" height="120">
<!--<![endif]-->
<xhtml:div>
<xhtml:h1>Alternative content</xhtml:h1>
<xhtml:p>
<xhtml:a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/
get_flash_player.gif" alt="Get Adobe Flash player" />
</xhtml:a>
</xhtml:p>
</xhtml:div>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</xhtml:div>
</xhtml:body>
</xhtml:html>

Philip Hutchison

unread,
Nov 7, 2010, 12:54:46 PM11/7/10
to swfo...@googlegroups.com
SWFObject was designed to work with HTML and XHTML (HTML written in an XML syntax but served as "text/html", not "application/xhtml+xml").  XForms are not HTML. 

The code you've posted below is not from the SWFObject project -- it has been modified to use an "xhtml" namespace prefix on all the elements. Here is SWFObject's sample XHTML, which works fine in all major browsers:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head>
        <title>SWFObject 2 static publishing example page</title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

        <script type="text/javascript" src="swfobject.js"></script>
        <script type="text/javascript">
        swfobject.registerObject("myId", "9.0.0", "expressInstall.swf");
        </script>
    </head>
    <body>

        <div>   
            <object id="myId" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="300" height="120">
                <param name="movie" value="test.swf" />
                <!--[if !IE]>-->
                <object type="application/x-shockwave-flash" data="test.swf" width="300" height="120">
                <!--<![endif]-->
                <div>
                    <h1>Alternative content</h1>
                    <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
                </div>

                <!--[if !IE]>-->
                </object>
                <!--<![endif]-->
            </object>
        </div>
    </body>
</html>


- philip





--
You received this message because you are subscribed to the Google Groups "SWFObject" group.
To post to this group, send email to swfo...@googlegroups.com.
To unsubscribe from this group, send email to swfobject+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/swfobject?hl=en.


Reply all
Reply to author
Forward
0 new messages