We often receive questions from netizens who are new to the Internet industry. Many of the problems are actually very simple and can be solved by just thinking about it. However, some netizens don’t like to think too much. When they encounter a problem, they just do it without thinking. Asking others is not a good way to learn. After the author of this article learned a technique, he found that the results displayed by this technique were different in the two environments. At this time, comparing the differences in the source code generated in the two environments is undoubtedly the best way to solve the problem! And that's exactly what he did, eventually solving the problem. The problems involved in this article are not too difficult, but the author's ideas for discovering and solving problems are worth learning!
First of all, I sincerely thank Lingyu5942 for helping me! Under his inspiration, I discovered another way to achieve a transparent background in flash. I would like to discuss with you
the solution told by Lingyu5942: Select windows mode/transparent windowless in the html publishing option of flash, publish it as html, and insert it into the web page. You can get the effect of transparent flash.
Yes, if you follow this method, you can publish an html page with transparent flash. But there is a problem: the published flash animation only displays the transparent effect in the html page published at the same time. If you use Dreamweaver to create a new file, insert it into the page, save->>f12 preview, we will find it. It’s opaque again! What's going on?
I carefully compared the source code of the HTML page published with flash and the two HTML pages with flash animation produced with Dreamweaver:
1. Source code of the HTML page published with flash:
<HTML>
<HEAD>
<TITLE>Movie2</TITLE>
</HEAD>
<BODY bgcolor="#000000">
<!-- 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 with flash, change the background to black. The purpose is to facilitate the observation of the transparency effect-->
<EMBED src="Movie2.swf" quality=high wmode=transparent bgcolor=#FFFFFF WIDTH=550 HEIGHT=400 TYPE="application/x-shockwave-flash" PLUGINSPAGE=" http://www.macromedia.com/shockwave /download/index.cgi?P1_Prod_Version
=ShockwaveFlash"></EMBED>
</OBJECT>
'www.knowsky.com
</BODY>
</HTML>
2. The source code of the html page with flash animation produced with dreamweaver:
<html>
<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, the purpose is to facilitate the observation of the transparency effect-->
<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>
<embed src="Movie2.swf" quality=high pluginspage=" http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version
=ShockwaveFlash" type="application/x-shockwave-flash" width="550" height="400">
</embed>
</object>
</body>
</html>
Please carefully compare and analyze the <embed> tag in the <object> tag of the two pieces of code. We found the difference: the former has the parameter wmode=transparent but the latter does not. This is the key to whether flash is transparent. Where!
Please think about the flash properties panel of Dreamweaver. Do you have any impression of parameter? Does everyone know its use?
Now let's use Dreamweaver to create a transparent effect: select the flash animation you just inserted, right-click the mouse and select properties to bring up the properties panel, then click the parameter button, click the plus icon in the pop-up dialog box, and click on the left Type wmode in parameter, type transparent in the value box on the right, click ok, press f12 to preview, ok! The transparent effect we want will appear!
Don't get excited yet, let's generalize this technique. Will it work for any animation that follows the default settings of flash (that is, does not modify windows mode/transparent windowless)? My experiments have proven that it is universally applicable. That is to say, after inserting any flash animation in Dreamweaver, setting properties→parameter→wmode→value=transparent can achieve the transparent background effect of flash.
In fact, there are many parameters for flash animation in Dreamweaver besides wmode. Please pay more attention and communicate more in future studies!