swfObject 使用说明
1.Embed your SWF with JavaScript
使用方法 swfobject.embedSWF(swfUrl, id, width, height, version, expressInstallSwfurl, flashvars, params, attributes, callbackFn) 包含5个必须参数及5个可选参数。
- swfUrl (String, required) specifies the URL of your SWF
- id (String, required) specifies the id of the HTML element (containing your alternative content) you would like to have replaced by your Flash content
- width (String, required) specifies the width of your SWF
- height (String, required) specifies the height of your SWF
- version (String, required) specifies the Flash player version your SWF is published for (format is: "major.minor.release" or "major")
- expressInstallSwfurl (String, optional) specifies the URL of your express install SWF and activates Adobe express install. Please note that express install will only fire once (the first time that it is invoked), that it is only supported by Flash Player 6.0.65 or higher on Win or Mac platforms, and that it requires a minimal SWF size of 310x137px.
- flashvars (Object, optional) specifies your flashvars with name:value pairs
- params (Object, optional) specifies your nested object element params with name:value pairs
- attributes (Object, optional) specifies your object's attributes with name:value pairs
- callbackFn (JavaScript function, optional) can be used to define a callback function that is called on both success or failure of creating a Flash plug-in <object> on the page (see API documentation)
注意:可选的参数你可以忽略,或者给它传递false值即可,对于flashvars,params,attributes参数,你也可以传递空对象{}.
2.How can you configure your Flash content?
你可以为attributes 对象指定如下可选的属性:
- id (NOTE: when undefined, the object element automatically inherits the id from the alternative content container element)
- align
- name
- styleclass (see note about class)
- class
styleclass 与class 都是指定样式,但因为class是js中的关键字,所以如果使用class时要用引号括起来。
Example:
var attributes = {
id: "myId",
align: "left",
styleclass: "myclass"
};
If you would rather use class instead of styleclass, wrap the word class in quotes like this:
var attributes = {
id: "myId",
align: "left",
"class": "myclass"
};
你还可以为params对象指定如下可选的属性:
- play
- loop
- menu
- quality
- scale
- salign
- wmode
- bgcolor
- base
- swliveconnect
- flashvars
- devicefont (more info)
- allowscriptaccess (more info here and here)
- seamlesstabbing (more info)
- allowfullscreen (more info)
- allownetworking (more info)
3.你可以忽略flashvars参数,而使用params对象的flashvars属性指定:
<script type="text/javascript"> var flashvars = false;
var params = {
menu: "false",
flashvars: "name1=hello&name2=world&name3=foobar"
};
var attributes = {
id: "myDynamicContent",
name: "myDynamicContent"
}; swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0","expressInstall.swf", flashvars, params, attributes); </script>
官方文档:https://code.google.com/p/swfobject/wiki/documentation
属性参数值配置:http://helpx.adobe.com/flash/kb/flash-object-embed-tag-attributes.html
使用flashvars参数传值到swf:http://helpx.adobe.com/flash/kb/pass-variables-swfs-flashvars.html
swfObject 使用说明的更多相关文章
- Atitit.项目修改补丁打包工具 使用说明
Atitit.项目修改补丁打包工具 使用说明 1.1. 打包工具已经在群里面.打包工具.bat1 1.2. 使用方法:放在项目主目录下,执行即可1 1.3. 打包工具的原理以及要打包的项目列表1 1. ...
- awk使用说明
原文地址:http://www.cnblogs.com/verrion/p/awk_usage.html Awk使用说明 运维必须掌握的三剑客工具:grep(文件内容过滤器),sed(数据流处理器), ...
- 使用 SWFObject.js 插入Flash
今天学习了一下使用 SWFObject.js 这个js插入flash. 下载地址:http://code.google.com/p/swfobject/ 这个js的好处 1.IE中没有讨厌的虚框问题了 ...
- “我爱背单词”beta版发布与使用说明
我爱背单词BETA版本发布 第二轮迭代终于画上圆满句号,我们的“我爱背单词”beta版本已经发布. Beta版本说明 项目名称 我爱背单词 版本 Beta版 团队名称 北京航空航天大学计算机学院 拒 ...
- Oracle 中 union 和union all 的简单使用说明
1.刚刚工作不久,经常接触oracle,但是对oracle很多东西都不是很熟.今天我们来了解一下union和union all的简单使用说明.Union(union all): 指令的目的是将两个 S ...
- Map工具系列-02-数据迁移工具使用说明
所有cs端工具集成了一个工具面板 -打开(IE) Map工具系列-01-Map代码生成工具说明 Map工具系列-02-数据迁移工具使用说明 Map工具系列-03-代码生成BySQl工具使用说明 Map ...
- Map工具系列-03-代码生成BySQl工具使用说明
所有cs端工具集成了一个工具面板 -打开(IE) Map工具系列-01-Map代码生成工具说明 Map工具系列-02-数据迁移工具使用说明 Map工具系列-03-代码生成BySQl工具使用说明 Map ...
- jQuery验证控件jquery.validate.js使用说明
官网地址:http://bassistance.de/jquery-plugins/jquery-plugin-validation jQuery plugin: Validation 使用说明 转载 ...
- gdbsever 使用说明
gdbsever 使用说明 在新塘N3292x平台下 编译 gdbsever ./configure --target=arm-linux --host=arm-linux arm-linux-gdb ...
随机推荐
- python zip函数介绍
首先用help(zip)来看一下帮助文档:
- Requests:Python HTTP Module学习笔记(一)(转)
Requests:Python HTTP Module学习笔记(一) 在学习用python写爬虫的时候用到了Requests这个Http网络库,这个库简单好用并且功能强大,完全可以代替python的标 ...
- python 遍历文件夹
import os import os.path rootdir = “d:\data” # 指明被遍历的文件夹 for parent,dirnames,filenames in os.walk(ro ...
- 整齐地输出n的平方,立方
初学C语言,有许多搞不明白的地方.编程,最重要的就是实践.今天,我偶然间看到书上的练习,做了一个能整齐地输出n,n的平方,n的立方的小程序.首先,我先用伪代码设计程序: 提示用户输入表格上限,下限或退 ...
- PF_RING 总结
1.背景 目前收包存在的问题: 第一:inpterrupt livelock, 当收到包的时候,网卡驱动程序就会产生一次中断.在大流量的情况下,操作系统将花费大量时间用于处理中断,而只有 少量的时间用 ...
- ED/EP系列7《指令速查表》
命 令 CLA INS ...
- mybatis数据库基本配置包括数据源事物类型等
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE configuration PUBLIC ...
- 基于Elasticsearch开发时的注意事项备忘
记录一些自己在Elasticsearch开发过程的琐碎知识点 1.使用ScriptFields时,需在yml配置文件中添加配置(script.disable_dynamic: false)开启动态脚本 ...
- [转]ubuntu 14.04 系统设置不见了
[转]ubuntu 14.04 系统设置不见了 http://blog.sina.com.cn/s/blog_6c9d65a10101i0i7.html 不知道删除什么了,系统设置不见了! 我在终端运 ...
- svn merge和branch
http://www.cnblogs.com/cxd4321/archive/2012/07/12/2588110.html 使用svn几年了,一直对分支和合并敬而远之,一来是因为分支的管理不该我操心 ...