Inserting a SWF file in HTML (GO)
In the Web page to insert the SWF, no ordinary, usually think of the following code:
HTML code
<object classid= "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase= "http://download.macromedia.com/pub/ shockwave/cabs/flash/swflash.cab#version=6,0,29,0 " Width=" " height=" > <param Name= "movie" value= "filename.swf" > <param name= "wmode" value= "Transparent" > <embed src= " filename.swf "width=" "height=" "type=" Application/x-shockwave-flash "/>"
which
<embed src= "filename.swf" width= "height="type
is to adapt to Firefox under the normal play to add to the
Sometimes under IE, with the first paragraph of code will be some inexplicable format problems.
--------------------------------------------------------------------------------------------------------------- -----------------------------
Now with the swfobject, everything is easy.
One, the most common format, simple to insert a SWF
<script type= "Text/javascript" src= "swfobject.js" ></script> <script type= "Text/javascript" > swfobject.embedswf ("test.swf", "FileID", "N", "a", "9.0.0", "expressinstall.swf"); </script> <body> <div id= "FileID"/>
The address of the parameter is in turn:
1, the SWF file address;
2. The ID of the container (such as DIV) used to load the SWF file;
3, the width of flash;
4, the height of flash;
5, the normal playback of the minimum required version of the Flash;
6, when the version is below the requirements, execute the SWF file, here to use this flash jump to the official download the latest version of the Flash plugin. (This parameter can be omitted)
Second, to the SWF pass parameters, variables and so on.
<script src= "swfobject.js" type= "Text/javascript" ></script> <script type= "Text/javascript" > var flashvars = "; var params = {menu: "false" "Noscale" "true" always ", bgcolor: "#FFFFFF" }; var attributes = {id: "FileID" }; swfobject.embedSWF ( "filename.swf", "Altcontent", "100%", "100%", "9.0.0", "expressinstall.swf", Flashvars, PA Rams, attributes); </script> <body> <div id= "FileID"/> </body>
In general, the first type is used more often.
"Reprint" Insert SWF file in HTML (GO)