flexpaper 背景色变化

1、mxml文件头部:添加 backgroundAlpha="0"

Flex代码  收藏代码
  1. <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"  
  2.                xmlns:mx="library://ns.adobe.com/flex/mx"  
  3.                xmlns:s="library://ns.adobe.com/flex/spark"  
  4.                width="510" height="510" <span style="color: #ff0000;">backgroundAlpha="0"</span>>  

2、Html:<param>标签下添加 <param name=“wmode” value=“transparent”/>

Html代码  收藏代码
  1. <noscript>  
  2.             <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="510" height="510" id="zhuanpan">  
  3.                 <param name="movie" value="zhuanpan.swf" />  
  4.                 <param name="quality" value="high" />  
  5.                 <param name="bgcolor" value="#ffffff" />  
  6.                 <param name="allowScriptAccess" value="sameDomain" />  
  7.                 <param name="allowFullScreen" value="true" />  
  8.         <span style="color: #ff0000;"><param name='wmode' value='transparent'></span>  
  9.                 <!--[if !IE]>-->  
  10.                 <object type="application/x-shockwave-flash" data="zhuanpan.swf" width="510" height="510">  
  11.                     <param name="quality" value="high" />  
  12.                     <param name="bgcolor" value="#ffffff" />  
  13.                     <param name="allowScriptAccess" value="sameDomain" />  
  14.                     <param name="allowFullScreen" value="true" />  
  15.             <span style="color: #ff0000;"><param name='wmode' value='transparent'/></span>  
  16.                 <!--<![endif]-->  
  17.                 <!--[if gte IE 6]>-->  
  18.                     <p>   
  19.                         Either scripts and active content are not permitted to run or Adobe Flash Player version  
  20.                         10.2.0 or greater is not installed.  
  21.                     </p>  
  22.                 <!--<![endif]-->  
  23.                     <a href="http://www.adobe.com/go/getflashplayer">  
  24.                         <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" />  
  25.                     </a>  
  26.                 <!--[if !IE]>-->  
  27.                 </object>  
  28.                 <!--<![endif]-->  
  29.             </object>  
  30.         </noscript>  

3、Html:<script>标签中 添加 params.wmode="transparent";

Js代码  收藏代码
  1. <script type="text/javascript">  
  2.             // For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection.   
  3.             var swfVersionStr = "10.2.0";  
  4.             // To use express install, set to playerProductInstall.swf, otherwise the empty string.   
  5.             var xiSwfUrlStr = "playerProductInstall.swf";  
  6.             var flashvars = {};  
  7.             var params = {};  
  8.             params.quality = "high";  
  9.             params.bgcolor = "#ffffff";  
  10.         <span style="color: #ff0000;">params.wmode="transparent";</span>  
  11.             params.allowscriptaccess = "sameDomain";  
  12.             params.allowfullscreen = "true";  
  13.             var attributes = {};  
  14.             attributes.id = "zhuanpan";  
  15.             attributes.name = "zhuanpan";  
  16.             attributes.align = "middle";  
  17.             swfobject.embedSWF(  
  18.                 "zhuanpan.swf""flashContent",   
  19.                 "510""510",   
  20.                 swfVersionStr, xiSwfUrlStr,   
  21.                 flashvars, params, attributes);  
  22.             // JavaScript enabled so display the flashContent div in case it is not replaced with a swf object.  
  23.             swfobject.createCSS("#flashContent""display:block;text-align:left;");  
  24.         </script>  

注:

透明功能主要是第2步中的设置。
下面看一下backgroundAlpha对程序效果的影像:
backgroundAlpha不为0时,在flashplayer中的效果

backgroundAlpha不为0时,在web页面中的效果

 

backgroundAlpha 为0时,在flashplayer中的效果

backgroundAlpha为0时,在web页面中的效果

原文地址:https://www.cnblogs.com/weipeng/p/3714496.html