1、mxml文件头部:添加 backgroundAlpha="0"
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:s="library://ns.adobe.com/flex/spark"
width="510" height="510" backgroundAlpha="0">
2、Html:<param>标签下添加 <param name=“wmode” value=“transparent”/>
<noscript> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="510" height="510" id="zhuanpan"> <param name="movie" value="zhuanpan.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="#ffffff" /> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" value="true" /> <param name='wmode' value='transparent'> <!--[if !IE]>--> <object type="application/x-shockwave-flash" data="zhuanpan.swf" width="510" height="510"> <param name="quality" value="high" /> <param name="bgcolor" value="#ffffff" /> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" value="true" /> <param name='wmode' value='transparent'/> <!--<![endif]--> <!--[if gte IE 6]>--> <p> Either scripts and active content are not permitted to run or Adobe Flash Player version 10.2.0 or greater is not installed. </p> <!--<![endif]--> <a href="http://www.adobe.com/go/getflashplayer"> <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" /> </a> <!--[if !IE]>--> </object> <!--<![endif]--> </object> </noscript>
3、Html:<script>标签中 添加 params.wmode="transparent";
<script type="text/javascript">
// For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection.
var swfVersionStr = "10.2.0";
// To use express install, set to playerProductInstall.swf, otherwise the empty string.
var xiSwfUrlStr = "playerProductInstall.swf";
var flashvars = {};
var params = {};
params.quality = "high";
params.bgcolor = "#ffffff";
params.wmode="transparent";
params.allowscriptaccess = "sameDomain";
params.allowfullscreen = "true";
var attributes = {};
attributes.id = "zhuanpan";
attributes.name = "zhuanpan";
attributes.align = "middle";
swfobject.embedSWF(
"zhuanpan.swf", "flashContent",
"510", "510",
swfVersionStr, xiSwfUrlStr,
flashvars, params, attributes);
// JavaScript enabled so display the flashContent div in case it is not replaced with a swf object.
swfobject.createCSS("#flashContent", "display:block;text-align:left;");
</script>
注:
透明功能主要是第2步中的设置。
下面看一下backgroundAlpha对程序效果的影像:
backgroundAlpha不为0时,在flashplayer中的效果