I. Code explanation
Code:
<Object classid = "clsid: D27CDB6E-AE6D-11cf-96B8-444553540000" codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"
WIDTH = "550" HEIGHT = "400">
<Param value = "myFlashMovie.swf">
<Param value = high>
<Param value = # FFFFFF>
<EMBED src = "/support/flash/ts/documents/myFlashMovie.swf" quality = high bgcolor = # ffffff width = "550" HEIGHT = "400"
NAME = "myMovieName" ALIGN = "" TYPE = "application/x-shockwave-flash"
PLUGINSPAGE = "http://www.macromedia.com/go/getflashplayer">
</EMBED>
</OBJECT>
Explanation:
The OBJECT tag is used in windows IE3.0 and later browsers or other browsers that support Activex controls. The "classid" and "codebase" attributes must be exactly written as shown in the preceding example. They tell the browser to automatically download the flash player address. If you have not installed flash player, then IE3.0 and later browsers will jump out of a prompt box to see if you want to automatically install flash player. Of course, if you do not want users who do not have flash player installed to automatically download the player, you may omit the code.
EMBED labels are used in Netscape Navigator2.0 and later browsers or other browsers that support the Netscape plug-in. The pluginspage attribute tells the browser the address for downloading the flash player. If flash player is not installed, restart the browser after installation.
To ensure that most browsers can normally display flash, you need to nest the EMBED tag in the OBJECT tag, just like the code example above. Browsers that support Activex controls will ignore the EMBED tag in the OBJECT tag. Netscape and IE browser using plug-ins will only read the EMBED tag, but will not recognize the OBJECT tag. That is to say, if you omit the EMBED tag, firefox will not be able to identify your flash (but it is puzzled that, If you omit the object, only embed will be written, and IE will be able to display the flash normally, take a closer look ).
This article lists the necessary and optional attributes of the OBJECT and EMBED labels used to publish a video.
1. required attributes:
· CLASSID-Set Activex controls of the browser for OBJECT labels only.
· CODEBASE-Set the location of the flash Activex control. If the browser is not installed, it can be automatically downloaded and installed. Only used for OBJECT tags.
· WIDTH-Specify the width of the flash video in percentages or pixels.
· HEIGHT-Specify the height of the flash video in percentages or pixels.
· SRC-Specify the video. Only for EMBED labels.
· PLUGINSPAGE-Set the location of the flash plug-in. If the browser is not installed, You can automatically download and install the plug-in. Only for EMBED labels.
· MOVIE-Specify the video. Only used for OBJECT tags.
2. Optional attributes and available values:
· ID-Set the variable name for reference to the script code. Only for objects.
· NAME-Set the variable name for reference of script code (such as javascript. EMBED only.
· SWLIVECONNECT-(True or false) Specifies whether to enable java when flash player is downloaded for the first time. If some attributes are omitted, the default value is false. If you use javascript and flash on the same page, java must use FSCommand to work.
· PLAY-(True or false) specifies whether the flash video is automatically played after the download is complete. If this attribute is omitted, the default value is true.
· LOOP-(True or false) Specifies whether to stop or continue loop playback after the last frame of the video is played. If this attribute is omitted, the default value is true.
· MENU-(True or false)
· True: displays all menus, allowing you to zoom in or zoom out to control video playback and other operations.
· False: only the set options and flash menus are displayed.
· QUALITY-(Low, high, autolow, autohigh, best)
· Low is faster than beautiful and does not apply anti-sawtooth.
· Autolow focuses on speed at the beginning, but it can be improved at any time when needed.
· Autohigh focuses on both playback speed and aesthetic, but sacrifices the aesthetic to ensure playback speed when needed.
· Medium applies some anti-sawtooth bitmap without smoothing the bitmap. Its quality is higher than the low setting but lower than the high setting.
· High aesthetics is superior to playback speed, and anti-aliasing is always applied. If the video does not contain an animation, the bitmap will be smoothed; if the video contains an animation, the bitmap will not change.
· Best provides the Best display quality without considering the playback speed. All outputs apply anti-sawtooth and all bitmaps are smoothed.
· SCALE-(Showall, noborder, exactfit)
· The Default (Show all) video is displayed in the specified area, but the original proportion is maintained. A border will appear on both sides of the video.
· No Boder compresses the film to fit the specified area and keeps the film undistorted. However, some films may be cropped. However, keep the original proportion of the video.
· Exact Fit enables the entire video to be displayed in the specified area. The film may be distorted without retaining the original proportion.
· ALIGN-(L, t, r, B)
· The default value is center. When the browser window is smaller than the video, the edge is cropped.
· Left, Right, Top, and Bottom are aligned along the edge of the browser according to the corresponding settings. If necessary, the other three sides will be cropped.
· SALIGN-(L, t, r, B, tl, tr, bl, br)
· L, R, T, B
· TL, TR
· BL, BR
· WMODE-(Window, opaque, transparent) sets the window mode attribute of the flash video, specifying the transparency, stack, and position of the flash in the browser.
· Window Film is played in the browser's rectangular Window.
· The Opaque film hides all content behind it.
· Transparent makes the flash video Transparent and displays the webpage content behind the Transparent video. This will reduce the animation performance. This attribute is not available in all browsers.
· BGCOLOR-(# RRGGBB, hexadecimal RGB value .) Specifies the background color of the video. Use this property to overwrite the background color set in flash.
· BASE-Set the reference directory or URL to solve the relative path in flash. Similar to the <base> label on a webpage.
· FLASHVARSTo pass variables to flash player, flash player6 and later versions are required.
· Pass the root variable to the video. The string format is the name = value set separated.
· The browser supports 64 kB String Length.
· For more information about FlashVars, see related documents. Ii. Tips (1) first, we will teach you the simplest way to insert Flash code, which is transparent and without coordinate control:
Note that wmode = "transparent" controls whether the Flash is transparent. If you do not want it to be transparent, simply remove wmode = "transparent.
<EMBED height = 360 pluginspage = http://www.macrom edia.com/go/getflashplayer
Src = http://imgfree.21cn.com/free/flash/17.swf
Type = application/x-shockwave-flash & nb sp; width = 500 wmode = "transparent"
Quality = "high"> </EMBED> (2) then teach everyone to add transparent Flash with absolute coordinates. Absolute coordinates mean that no matter how big your window is, the Flash still stays unchanged. <EMBED style = "LEFT: 250px; WIDTH: 550px; POSITION: & nbs p; absolute; TOP:
200px; HEIGHT: 1000px "align = right src = http://user.hjenglish.com/yangbb/
Pics/snow.swf width = 500 height = 2000 type = appl ication/octet-stream;
Quality = "high" wmode = "transparent"> (3) Finally, we will teach you how to add transparent Flash with relative coordinates. Pay attention to the table section of the Code below. This mainly uses tables as containers, flash
"Install" into the table, so that no matter whether the browser is large, Flash will always move with the table. In addition, you can set a background image for the table.
Ming Flash works with the background image. Wow, the effect is very good <table border = "0" cellPadding = "0" cellSpacing = "0" width = 600 height = 382
Align = center backg
Round = http://image.hjbbs.com/img/200410/200410259222581234.j pg>
<TD width = 600 height = 382> <EMBED plug
Inspage = http://www.macromedia.com/go/getflashplayer & nb sp;
Src = http://user.hjenglish.com/yangbb/pics/hearts.swf wi dth = "100%"
Height = "100%"
Type = application/x-shockwave-flash wmode = "transparent"
Quality = "high"> </EMBED> </TD> </td> </table> ------------------------------------------------------ the following methods are available: based on the Web page layout implementation method, you can first prepare an image and a flash suitable for transparent effect, then open a new webpage in DREAMWEAVER, insert a row and a column
Cell. The cell size is the same as the width and height of the prepared image. Then, set the image as the background image of the cell. After the settings are complete, insert a limit in the cell.
Flash has been prepared, and the flash size should be adjusted to the same size as the cell. Select flash with the mouse, and change the webpage editing status from "design"
Switch to "code, you will see that the flash part has turned black in the source code, the code example is as follows: <object classid =" clsid: D27CDB6E-AE6D-11cf-96B8-444553540000 "codebase ="
[Url] http://download.macromedia.com/pub/shockwave/cabs/flash/swfl#/url]
Ash. cab # version = 6, 0, 470 "width =" 180 "height =" ">
<Param name = "movie" value = "0.swf">
<Param name = "quality" value = "high">
<Embed src = "0.swf" quality =" high"
Pluginspage = "http://www.macromedia.com/go/getflashplayer"
Type = "application/x-shockwave-flash" width = "470" height = "180"> </embed>
</Object> Insert the following code into the above Code: <param name = "wmode" value = "transparent"> the complete code is as follows: <object classid = "clsid: d27CDB6E-AE6D-11cf-96B8-444553540000 "codebase ="
[Url] http://download.macromedia.com/pub/shockwave/cabs/flash/swfl#/url]
Ash. cab # version = 6, 0, 470 "width =" 180 "height =" ">
<Param name = "movie" value = "0.swf">
<Param name = "wmode" value = "transparent">
<Param name = "quality" value = "high">
<Embed src = "0.swf" quality =" high"
Pluginspage = "http://www.macromedia.com/go/getflashplayer"
Type = "application/x-shockwave-flash" width = "470" height = "180"> </embed>
</Object> grasp the core idea based on CSS layout, insert flash into the DIV label of the background image, and add the above Code to the flash part. Select windows mode/t ransparent in the html publishing option of flash.
Windowless, published as html, you can insert a webpage to get the transparent flash effect. Yes. In this way, you can publish html pages with transparent flash. However, there is a problem: the released flash animation only corresponds
The html page released at the same time displays transparent results. If you use dreamweaver to create a new file, insert it into the page and save --> & g
T; f12 preview we will find it is not transparent again! What's going on? I carefully compared the source code of the html pages published in flash and the two html pages with flash Animation produced in dreamweaver: 1. source code of the html pages published in flash: <HTML>
<HEAD>
<TITLE> Movie2 </TITLE>
</HEAD>
<BODY bgcolor = "#000000" type = "codeph" text = "/codeph">
<! -- URL's used in the movie -->
<! -- Text used in the movie -->;
<! -- Fdsaaaa aaaaaaa --> <OBJECT classid = "clsid: D27CDB6E-AE6D-11cf-96B8-444553540000"
Codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash
/Swflash. cab # version = 5, 0, 0, 0"
WIDTH = 550 HEIGHT = 400>
<Param name = movie value = "Movie2.swf">
<Param name = quality value = high>
<Param name = wmode value = transparent>
<Param name = bgcolor value = # FFFFFF> <! -- After exporting the image with flash, change the background to black to make it easier to observe the transparent effect. -->
<EMBED src = "Movie2.swf" quality = high wmode = transparent bgcolor = # FFFF FF
WIDTH = 550 HEIGHT = 400 TYPE = "application/x-shockwave-flash" PLUGINSPAGE ="
[Url] http://www.macromedia.com/shockwave/download/index.cgi? P1_Pr [/url]
Od_Version
= ShockwaveFlash "> </EMBED>
</OBJECT> </BODY>
</HTML> 2. source code of the html page with flash Animation produced with dreamweaver: <Head>
<Title> Untitled document </title>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
</Head> <body bgcolor = "#000000" text = "#000000"> <! -- The background is also black, so that you can easily observe the transparent effect -->
<Object classid = "clsid: D27CDB6E-AE6D-11cf-96B8-444553540000"
Codebase = "http://download.macromedia.com/pub/shockwave/cabs/flash
/Swflash. cab # version = 5, 0, 0 "width =" 550 "height =" 400 ">
<Param name = movie value = "Movie2.swf">
<Param name = quality value = high>
<Embed src = "Movie2.swf" quality = high pluginspage ="
[Url] http://www.macromedia.com/shockwave/download/index.cgi? P1_Pr [/url]
Od_Version
= ShockwaveFlash "type =" application/x-shockwave-flash "width =" 550"
Height = "400">
</Embed>
</Object>
</Body>
</Html> carefully analyze the <embed> tag in the <object> tag of the two sections of code. The differences are as follows:
The former has the parameter wmode = transparent, but the latter does not. This is the key to affecting the transparency of flash! Do you have an impression on the flash attribute panel of dreamweaver? Do you know its usefulness? Now let's use dreamweaver for transparency: select the inserted flash animation, right-click and select properties to bring up
On the Properties panel, click the parameter button. In the displayed dialog box, click the plus icon, and in the left-side parameter, enter wmode on the right.
Enter transparent in the value box and click OK. Press f12 to preview. OK! The transparent effect we want is displayed! Do not be excited. We will promote this technique to see if it can be set by default for any flash (that is, it does not apply to windows mode/tr ansparent
Does the animation work? My experiments have proved that it is widely used. That is to say, in d
After inserting any flash animation in reamweaver, perform properties → parameter → wmode →
Value = transparent settings can all achieve transparent background Effects of flash. Contents <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 = "789" height = "283">
<Param name = "movie" value = "tit.swf">
<Param name = "quality" value = "high">
<Embed src = ".. /images/tit.swf "quality =" high "pluginspage =" http://www.macromedia.com/go/getflashplayer "type =" application/x-shockwave-flash "width =" 789 "height =" 283 "> </embed>
</Object>