在 swfobject 中嵌入 swf 时遇到问题

发布于 2024-10-12 12:56:19 字数 2652 浏览 3 评论 0 原文

我正在按照此处的步骤操作:

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

我是这样嵌入的:

<!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 dynamic embed - step 3</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <style type="text/css" media="screen">
      html, body, #myContent { height:100%; }
      body { margin:0; padding:0; overflow:hidden; }
    </style>
    <script type="text/javascript" src="js/swfobject/swfobject.js"></script>

    <script type="text/javascript">
    swfobject.embedSWF("flash/main.swf?sessionId=psjqbunbdoapfqt1cskggvsdi2", "myContent", "100%", "100%", "9.0.0", "js/swfobject/expressInstall.swf");

    </script>

  </head>
  <body>
  <table style="width:100%;height:100%;">
    <tr>
        <td style="width:350px">
            <div id="myContent">
              <p>Alternative content</p>

            </div>
            <noscript>
                <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
                        id="main" width="100%" height="100%"
                        codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
                        <param name="movie" value="flash/main.swf?sessionId=psjqbunbdoapfqt1cskggvsdi2" />
                        <param name="quality" value="high" />
                        <param name="bgcolor" value="#eeeeee" />
                        <param name="allowScriptAccess" value="sameDomain" />
                        <embed src="flash/main.swf?sessionId=psjqbunbdoapfqt1cskggvsdi2" quality="high" bgcolor="#eeeeee"
                            width="100%" height="100%" name="main" align="middle"
                            play="true"
                            loop="false"
                            quality="high"
                            allowScriptAccess="sameDomain"
                            type="application/x-shockwave-flash"
                            pluginspage="http://www.adobe.com/go/getflashplayer">
                        </embed>
                </object>
            </noscript>
        </td>
    </tr>
  </table>
  </body>

</html>

结果发现flash内容根本不可见,为什么?

I'm following the steps here:

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

I'm embedding it this way:

<!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 dynamic embed - step 3</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <style type="text/css" media="screen">
      html, body, #myContent { height:100%; }
      body { margin:0; padding:0; overflow:hidden; }
    </style>
    <script type="text/javascript" src="js/swfobject/swfobject.js"></script>

    <script type="text/javascript">
    swfobject.embedSWF("flash/main.swf?sessionId=psjqbunbdoapfqt1cskggvsdi2", "myContent", "100%", "100%", "9.0.0", "js/swfobject/expressInstall.swf");

    </script>

  </head>
  <body>
  <table style="width:100%;height:100%;">
    <tr>
        <td style="width:350px">
            <div id="myContent">
              <p>Alternative content</p>

            </div>
            <noscript>
                <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
                        id="main" width="100%" height="100%"
                        codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
                        <param name="movie" value="flash/main.swf?sessionId=psjqbunbdoapfqt1cskggvsdi2" />
                        <param name="quality" value="high" />
                        <param name="bgcolor" value="#eeeeee" />
                        <param name="allowScriptAccess" value="sameDomain" />
                        <embed src="flash/main.swf?sessionId=psjqbunbdoapfqt1cskggvsdi2" quality="high" bgcolor="#eeeeee"
                            width="100%" height="100%" name="main" align="middle"
                            play="true"
                            loop="false"
                            quality="high"
                            allowScriptAccess="sameDomain"
                            type="application/x-shockwave-flash"
                            pluginspage="http://www.adobe.com/go/getflashplayer">
                        </embed>
                </object>
            </noscript>
        </td>
    </tr>
  </table>
  </body>

</html>

It turns out that the flash content is not visibie at all,why?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

如歌彻婉言 2024-10-19 12:56:19

去掉所有额外的东西,比如

< /code> (也没有样式属性!)在一个空的 HTML 结构中。

如果根本不显示:您的 swf 有问题,或者 swfobject 未正确加载。

如果确实显示:开始添加内容。首先重新输入样式属性。重新加载。继续直到你的内容消失=>你知道你的问题出在哪里!

另外:我建议不要在其中添加额外的

Get rid of all the additional stuff, like the <table>, <noscript>, CSS etc. Just leave swfobject and the <div> (no style attributes, either!) in an otherwise empty HTML construct.

If it doesn't show at all: There is something wrong with your swf, or swfobject doesn't load correctly.

If it does show: Start adding stuff. First re-enter the style attributes. Reload. Go on until your content disappears => you know where your problem is!

Also: I would advise not to put an additional <noscript>in there - that's what "alternative content" is meant for. You should really put something alternative in there, like a picture or text, and link to the flash plugin download page.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文