0

我有一个名为abc.swf我想在用户首次注册我们的网站时播放的 Flash 视频。但是,如果用户没有闪光灯,我需要它以一种简单的方式告诉他们。

出于这个原因,我试图告诉他们如何使用以下 html 下载 Flash:

<div style="text-align:center;"> 
    <p><strong>You do not have Flash installed, or it is older than the required 10.0.0.</strong></p>
    <p><strong>Click below to install the latest version and then try again.</strong></p>
    <p><a target="_blank" href="https://www.adobe.com/go/getflashplayer">
        <img src="images/get_flash_player.png" width="112" height="33" alt="Get Adobe Flash player" />
    </a></p>
</div>

困难的部分(对我来说,希望不适合你^^)是让它只在他们没有安装闪存时显示。这是我到目前为止所拥有的:

    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" 
                codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"
                width="720" height="488" id="xxx" align="middle">
            <param name="allowScriptAccess" value="sameDomain" />
            <param name="allowFullScreen" value="false" />
            <param name="movie" value="abc.swf" />
            <param name="quality" value="high" />
            <param name="wmode" value="gpu" />
            <param name="bgcolor" value="#ffffff" />
            <embed src="abc.swf" quality="high" wmode="gpu" bgcolor="#ffffff" 
            width="720" height="488" name="abc" 
            align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" 
            pluginspage="http://www.adobe.com/go/getflashplayer" />
            <div style="text-align:center;"> 
                <p><strong>You do not have Flash installed, or it is older than the required 10.0.0.</strong></p>
                <p><strong>Click below to install the latest version and then try again.</strong></p>
                <p><a target="_blank" href="https://www.adobe.com/go/getflashplayer">
                    <img src="images/get_flash_player.png" width="112" height="33" alt="Get Adobe Flash player" />
                </a></p>
           </div>
</object>

但无论他们是否安装了 Flash,它都会显示下载 Flash 消息,并且它显示在视频下方(或者如果安装了 Flash,视频将在哪里)。

有没有办法做到这一点?谢谢!

4

2 回答 2

3

您可以使用SWFObject

<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
swfobject.embedSWF("abc.swf", "flashcontent", "720", "488", "10.0.0")
</script>

<div id="flashcontent">
<p><strong>You do not have Flash installed, or it is older than the required 10.0.0. </strong></p>
<p><strong>Click below to install the latest version and then try again.</strong></p>
<p><a target="_blank" href="https://www.adobe.com/go/getflashplayer">
<img src="images/get_flash_player.png" width="112" height="33" alt="Get Adobe Flash player" />
</a></p>
</div>

只需下载 swfobject 并将其放在同一目录中。然后将此代码复制并粘贴到您的页面上,它应该可以执行您想要的操作。

于 2010-07-13T20:48:25.390 回答
0

您应该使用 javascript 动态创建对象,然后检查对象是否成功加载,如果没有,然后将您的消息打印到屏幕上。

于 2010-07-13T19:37:43.400 回答