Swfobject is a simple and easy-to-use method for embedding and detecting JS Code in flash. I personally think it is more convenient and easier to use than Adobe officially provides. This version is greatly changed.
Swfobject2.0 currently provides two main call methods.
1.swf object. registerobject (flashcontentid, flashversion, expressinstallurl );
Flashcontentid is the flash ID;
Flashversion is the player version for playing SWF;
Expressinstallurl is the SWF call address for Flash Player Update and installation. If the current version is earlier than flashversion, it is automatically updated.
<HTML xmlns = "http://www.w3.org/1999/xhtml" lang = "en" XML: lang = "en"> </P> <p> <pead> </P> <p> <title> swfobject V2.0 Sample page </title> <br/> <Meta HTTP-equiv = "Content-Type" content = "text/html; charset = iso-8859-1 "/> </P> <p> <MCE: Script Type =" text/JavaScript "src =" swfobject. JS "mce_src =" swfobject. JS "> </MCE: SCRIPT> <br/> <MCE: Script Type =" text/JavaScript "> <! -- </P> <p> swfobject. registerobject ("myid", "9.0.0", "expressinstall.swf"); <br/> // --> </MCE: SCRIPT> <br/> </pead> <br/> <body> </P> <p> <div> </P> <p> <Object ID = "myid "classid =" CLSID: d27CDB6E-AE6D-11cf-96B8-444553540000 "width =" 300 "Height =" 120 "> </P> <p> <Param name =" movie "value =" test.swf "/> </P> <p> <div> </P> <p> <p> alternative content </p> <br/> <p> <br/> <a href = "http://www.adobe.com/go/getflashplayer" mce_href = "http://www.adobe.com/go/getflashplayer"> <br/> <br/> </a> </ p> <br/> </div> <br/> </Object> <br/> </div> <br/> </body> <br/> </ HTML> <br/>
<HTML xmlns = "http://www.w3.org/1999/xhtml" lang = "en" XML: lang = "en"> </P> <p> <pead> </P> <p> <title> demo </title> <br/> <meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8 "/> </P> <p> <MCE: Script Type =" text/JavaScript "src =" swfobject. JS "mce_src =" swfobject. JS "> </MCE: SCRIPT> <br/> <MCE: Script Type =" text/JavaScript "> <! -- </P> <p> var flashvars ={}; </P> <p> flashvars. sn = "a00001"; </P> <p> var Params ={}; </P> <p> Params. menu = "false"; </P> <p> Params. quality = "autohigh"; </P> <p> Params. wmode = "Opaque"; </P> <p> Params. allowfullscreen = "true"; </P> <p> Params. allowScriptAccess = "always"; </P> <p> Params. allownetworking = "all"; </P> <p> var attributes ={}; </P> <p> swfobject. embedswf ("test.swf", "flashcontent", "300", "120", "9.0.0", "expressinstall.swf", flashvars, Params, attributes ); <br/> // --> </MCE: SCRIPT> <br/> </pead> <br/> <body> </P> <p> <Div id = "flashcontent"> </P> <p> <a href = "http://www.adobe.com/go/getflashplayer" mce_href = "http://www.adobe.com/go/getflashplayer"> </P> <p> </P> <p> </a> </div> </body> <br/> </ptml> <br/>
2.swf object. embedswf (swfurl, replaceelementid, swfwidth, swfheight, flashversion, expressinstallurl, flashvars, Params, attributes );
Swfurl is the address of the SWF call;
Replaceelementid is the ID of the container to be used with flash;
Swfwidth is the SWF width;
Swfheight is the SWF height;
Flashversion is the player version for playing SWF;
Expressinstallurl is the SWF call address for Flash Player Update and installation. If the current version is earlier than flashversion, it is automatically updated.
Flashvars is the variable value passed by flashvars;
Params is the parameter settings of the Flash Player control, for example, menu = "false ";
Attributes is the attribute value of the Flash Player control, for example, class = "flashstyle ";