zoukankan      html  css  js  c++  java
  • flex也可以让背景透明

    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页面中的效果

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

  • 相关阅读:
    SAP MM 有了采购订单历史的PO行项目里的采购附加费不允许再改了?
    风之语.人在职场也需要'备胎'
    两万字,任正非采访全记录
    SAP 如何得到交货单上的序列号清单?
    【2019年版】如何向SAP公司提交Message?
    工作上996,生活上669,并不是什么难事儿!
    风之语.甲骨文裁员之我见
    天河2号-保持使用yhrun/srun时连接不中断 (screen 命令教程 )
    PXE 和 计算机网络启动
    Gmail 设置,时区
  • 原文地址:https://www.cnblogs.com/zack/p/1496482.html
Copyright © 2011-2022 走看看