flex也可以让背景透明

it2022-05-05  124

1、mxml文件中 <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundColor="red" backgroundAlpha="0"> 主要是backgroundAlpha="0" 2、index.template.html文件中 <body scroll="no"> <script language="JavaScript" type="text/javascript"> <!-- // Version check for the Flash Player that has the ability to start Player Product Install (6.0r65) var hasProductInstall = DetectFlashVer(6, 0, 65);

// Version check based upon the values defined in globals var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

if ( hasProductInstall && !hasRequestedVersion ) { // DO NOT MODIFY THE FOLLOWING FOUR LINES // Location visited after installation is complete if installation is required var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn"; var MMredirectURL = window.location;     document.title = document.title.slice(0, 47) + " - Flash Player Installation";     var MMdoctitle = document.title;

AC_FL_RunContent(    "src", "playerProductInstall",    "FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",    "width", "${width}",    "height", "${height}",    "align", "middle",    "id", "${application}",    "quality", "high",    "bgcolor", "${bgcolor}",    "wmode", "transparent", //add by zhangsk 2009-02-09 透明背景    "name", "${application}",    "allowScriptAccess","sameDomain",    "type", "application/x-shockwave-flash",    "pluginspage", "http://www.adobe.com/go/getflashplayer" ); } else if (hasRequestedVersion) { // if we've detected an acceptable version // embed the Flash Content SWF when all tests are passed AC_FL_RunContent(     "src", "${swf}",     "width", "${width}",     "height", "${height}",     "align", "middle",     "id", "${application}",     "quality", "high",     "bgcolor", "${bgcolor}",     "wmode", "transparent", //add by zhangsk 2009-02-09 透明背景     "name", "${application}",     "allowScriptAccess","sameDomain",     "type", "application/x-shockwave-flash",     "pluginspage", "http://www.adobe.com/go/getflashplayer" ); } else { // flash is too old or we can't detect the plugin     var alternateContent = 'Alternate HTML content should be placed here. ' + 'This content requires the Adobe Flash Player. '    + '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';     document.write(alternateContent); // insert non-flash content } // --> </script> <noscript> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"     id="${application}" width="${width}" height="${height}"     codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">     <param name="movie" value="${swf}.swf" />     <param name="quality" value="high" />     <param name="bgcolor" value="${bgcolor}" />     <param name="allowScriptAccess" value="sameDomain" />     <param name='wmode' value='transparent'><!--//add by zhangsk 2009-02-09 透明背景// -->     <embed src="${swf}.swf" quality="high" bgcolor="${bgcolor}"      width="${width}" height="${height}" name="${application}" align="center"      play="true"      loop="false"      quality="high"      allowScriptAccess="sameDomain"      type="application/x-shockwave-flash"      pluginspage="http://www.adobe.com/go/getflashplayer"      wmode="transparent">     </embed> </object> </noscript> </body> </html> 主要是:"wmode", "transparent"的设置 3、透明功能主要是第2步中的设置。 下面看一下backgroundAlpha对程序效果的影像: backgroundAlpha不为0时,在flashplayer中的效果

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

backgroundAlpha 为0时,在flashplayer中的效果

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

这回知道如何选择想要的透明效果了吧。 最后看看透明的效果如何

转载于:https://www.cnblogs.com/zack/archive/2009/06/04/1496482.html

相关资源:各显卡算力对照表!

最新回复(0)