Official Website Introduction
Http://code.google.com/p/swfobject/wiki/documentation
Usage:
HTML section
<Div id = "swf1">... </div>
JS Section
Swfobject. embedswf ("test.swf", "swf1", "300", "120", "9.0.0 ",);
Source code:
This is the source code in 2.2. You can see how to use the parameters.
Embedswf: function (swfurlstr, replaceelemidstr, widthstr, heightstr, swfversionstr, xiswfurlstr, flashvarsobj, parobj, attobj, callbackfn ){
....}
Details
First, you need to understand the object tag.
Http://www.w3school.com.cn/tags/tag_object.asp
Http://www.w3school.com.cn/tags/tag_param.asp
Swfurlstr, replaceelemidstr, widthstr, heightstr, swfversionstr, xiswfurlstr
These are in sequence, SwF position, and HTML should be replaced with the flash element ID, width, height, and Flash version. If there is no flash, use this automatically installed FLASH file swfobject2.2 in the source file.
Flashvarsobj: the value of flashvars. This is often used as a parameter passed between HTML and Flash. It is originally an attribute in the Params object. It is obtained separately because of its common usage and convenience. It can be set to null. Then write In Param.
Param object attributes:
Detailed introduction to http://kb2.adobe.com/cps/127/tn_12701.html
Play, loop, menu, quality, scale, salign, bgcolor, base, swliveconnect, flahvars, devicefont, allowScriptAccess, seamlesstabbing, allowfullscreen, allownetworking
Wmode is very important,Window, opaque, transparent (usually set
Transparent
Transparent or opaque is not transparent ). If this parameter is not set, window is displayed by default. At this time, the object element will always be displayed at the top, and the click event will not be listened.
Attributes of the attributes object: ID, name, styleclass (do not use class, because class is also the reserved keyword of ecma4), align
Callbackfn: callback function
Demo
Demo 1
swfobject. embedswf ( "test6_flashvars.swf" , "content5" , "300" , "120" , "6.0.0" , "expressinstall.swf" , {name1: "hello" , name2: "world" , name3: "foobar" }, {menu: "false" }, {ID: "dynamiccontent5" , Name: "dynamiccontent5" }); |
Demonstration 2
Swfobject. embedswf ( "Test6_flashvars.swf" , "Content2" , "300" , "120" , "6.0.0" , "Expressinstall.swf" , Flashvars, Params, attributes ); |
Demonstration 3
var flashvars ={}; flashvars. xmlpath = "data. XML " ; var Params ={}; Params. wmode = "Transparent" ; var attributes ={}; swfobject. embedswf ( "xixi.swf" , "banner" , "960" , "250" , "9.0.0" , "expressinstall.swf" , flashvars, Params, attributes ); |
Demonstration 4
Swfobject. embedswf ( "Gen_shu.swf" , "Gen_swf1" , "180" , "105" , "9.0.0" , Null , Null , {Wmode: "Transparent" }, Null , Function () {Alert ( "Flash loaded successfully" )}); |
JS call Method
Http://code.google.com/p/swfobject/wiki/api
Reprinted: http://www.cnblogs.com/lunalord/archive/2011/03/03/1967992.html
Official Website Introduction
Http://code.google.com/p/swfobject/wiki/documentation
Usage:
HTML section
<Div id = "swf1">... </div>
JS Section
Swfobject. embedswf ("test.swf", "swf1", "300", "120", "9.0.0 ",);
Source code:
This is the source code in 2.2. You can see how to use the parameters.
Embedswf: function (swfurlstr, replaceelemidstr, widthstr, heightstr, swfversionstr, xiswfurlstr, flashvarsobj, parobj, attobj, callbackfn ){
....}
Details
First, you need to understand the object tag.
Http://www.w3school.com.cn/tags/tag_object.asp
Http://www.w3school.com.cn/tags/tag_param.asp
Swfurlstr, replaceelemidstr, widthstr, heightstr, swfversionstr, xiswfurlstr
These are in sequence, SwF position, and HTML should be replaced with the flash element ID, width, height, and Flash version. If there is no flash, use this automatically installed FLASH file swfobject2.2 in the source file.
Flashvarsobj: the value of flashvars. This is often used as a parameter passed between HTML and Flash. It is originally an attribute in the Params object. It is obtained separately because of its common usage and convenience. It can be set to null. Then write In Param.
Param object attributes:
Detailed introduction to http://kb2.adobe.com/cps/127/tn_12701.html
Play, loop, menu, quality, scale, salign, bgcolor, base, swliveconnect, flahvars, devicefont, allowScriptAccess, seamlesstabbing, allowfullscreen, allownetworking
Wmode is very important,Window, opaque, transparent (usually set
Transparent
Transparent or opaque is not transparent ). If this parameter is not set, window is displayed by default. At this time, the object element will always be displayed at the top, and the click event will not be listened.
Attributes of the attributes object: ID, name, styleclass (do not use class, because class is also the reserved keyword of ecma4), align
Callbackfn: callback function
Demo
Demo 1
swfobject. embedswf ( "test6_flashvars.swf" , "content5" , "300" , "120" , "6.0.0" , "expressinstall.swf" , {name1: "hello" , name2: "world" , name3: "foobar" }, {menu: "false" }, {ID: "dynamiccontent5" , Name: "dynamiccontent5" }); |
Demonstration 2
Swfobject. embedswf ( "Test6_flashvars.swf" , "Content2" , "300" , "120" , "6.0.0" , "Expressinstall.swf" , Flashvars, Params, attributes ); |
Demonstration 3
var flashvars ={}; flashvars. xmlpath = "data. XML " ; var Params ={}; Params. wmode = "Transparent" ; var attributes ={}; swfobject. embedswf ( "xixi.swf" , "banner" , "960" , "250" , "9.0.0" , "expressinstall.swf" , flashvars, Params, attributes ); |
Demonstration 4
Swfobject. embedswf ( "Gen_shu.swf" , "Gen_swf1" , "180" , "105" , "9.0.0" , Null , Null , {Wmode: "Transparent" }, Null , Function () {Alert ( "Flash loaded successfully" )}); |
JS call Method
Http://code.google.com/p/swfobject/wiki/api
Reprinted: http://www.cnblogs.com/lunalord/archive/2011/03/03/1967992.html