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

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

问题描述

如何在 HTML 页面中嵌入 SWF 文件?

解决方案

将 SWF 嵌入 HTML 页面的最佳方法是使用 SWFObject.

它是一个简单的开源 JavaScript 库,是一种易于使用且符合标准的嵌入 Flash 内容的方法.

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

文档中的示例:

<!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"><头><title>SWFObject 动态嵌入 - 步骤 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");<身体><div id="myContent"><p>替代内容</p>

与此一起使用的好工具是 SWFObject HTML 和 JavaScript 生成器.它基本上生成使用 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天全站免登陆