我可以在全屏闪光灯中使用透明背景吗?

时间:2011-05-31 13:04:54

标签: flash flex fullscreen transparent wmode

在闪光灯的全屏模式下,有没有办法获得透明背景?我尝试了以下方法:

<!DOCTYPE HTML>
<html>
<head>
  <style type="text/css">
  body{background:#666;}
  </style>
  <script src="http://ajax.googleapis.com/ajax/libs/swfobject/2.1/swfobject.js"></script>
  <script type="text/javascript">
    var flashVars = {};
    var params = {
      allowFullScreen: "true",
      wmode: "transparent",
      allowScriptAccess: "sameDomain"
    };

    swfobject.embedSWF( "fullscreen.swf", "swf", "400", "200", "10.0.0", "fullscreen.swf", flashVars, params );
  </script>
</head>
<body>
  <h1>Fullscreen Test</h1>
  <div id="swf">
  </div>
</body>
</html>

fullscreen.swf我编译的宽度Flex 4.5:

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" backgroundAlpha="0" >
  <mx:Script>
   <![CDATA[
    public function toggleFullScreen():void {
      if (this.stage.displayState == StageDisplayState.NORMAL) {
        this.stage.displayState = StageDisplayState.FULL_SCREEN;
      }
      else {
        this.stage.displayState = StageDisplayState.NORMAL;
      }
    }
   ]]>
  </mx:Script>
  <mx:Button label="Fullscreen" click="this.toggleFullScreen();"/>
</mx:Application>

1 个答案:

答案 0 :(得分:1)

我很确定这是不可能的..

编辑: 这是不可能的..

EDIT2: 添加了链接

来自AS3文档link

注意:如果将窗口模式(HTML中的wmode)设置为Opaque Windowless(不透明)或Transparent Windowless(透明),则全屏窗口始终不透明