如何在HTML页面中嵌入SWF文件? [英] How to embed a SWF file in an HTML page?

查看:482
本文介绍了如何在HTML页面中嵌入SWF文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将SWF文件嵌入到HTML中的最佳方法是将SWF文件嵌入到HTML页面中页面是使用 SWFObject



它是一个简单的开源JavaScript库,它是易于使用和标准友好的方法来嵌入Flash内容。



它还提供Flash播放器版本检测。如果用户没有所需的Flash版本或禁用JavaScript,他们将看到一个替代内容。您也可以使用此库来触发Flash Player升级。一旦用户升级,他们将被重定向回页面。



文档示例:

 <!DOCTYPE html PUBLIC -  // W3C // DTD XHTML 1.0 Strict // ENhttp://www.w3.org/TR/xhtml1/DTD/xhtml1- strict.dtd> 
< head>
< title> SWFObject动态嵌入 - 第3步< / title>
< meta http-equiv =Content-Typecontent =text / html; charset = iso-8859-1/>
< script type =text / javascriptsrc =swfobject.js>< / script>

< script type =text / javascript>
swfobject.embedSWF(myContent.swf,myContent,300,120,9.0.0);
< / script>

< / head>
< body>
< div id =myContent>
< p>替代内容< / p>
< / div>
< / body>
< / html>

与此一起使用的一个好工具是SWFObject HTML和JavaScript generator 。它基本上生成您需要使用SWFObject嵌入Flash的HTML和JavaScript。为您提供一个非常简单的用户界面,您可以输入您的参数。



强烈建议使用,非常简单。


How do you embed a SWF file in an HTML page?

解决方案

The best approach to embed a SWF into an HTML page is to use SWFObject.

It is a simple open-source JavaScript library that is easy-to-use and standards-friendly method to embed Flash content.

It also offers Flash player version detection. If the user does not have the version of Flash required or has JavaScript disabled, they will see an alternate content. You can also use this library to trigger a Flash player upgrade. Once the user has upgraded, they will be redirected back to the page.

An example from the 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=iso-8859-1" />
    <script type="text/javascript" src="swfobject.js"></script>

    <script type="text/javascript">
        swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0");
    </script>

  </head>
  <body>
    <div id="myContent">
      <p>Alternative content</p>
    </div>
  </body>
</html>

A good tool to use along with this is the SWFObject HTML and JavaScript generator. It basically generates the HTML and JavaScript you need to embed the Flash using SWFObject. Comes with a very simple UI for you to input your parameters.

It Is highly recommended and very simple to use.

这篇关于如何在HTML页面中嵌入SWF文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆