Flex全屏问题

来源:互联网 发布:sql server 2005 32 编辑:程序博客网 时间:2024/05/15 02:55
<?xml version="1.0" encoding="utf-8"?><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"  backgroundGradientColors="[#294B88, #3F7ACA]" color="#FFFFFF">    <mx:Script>        <![CDATA[            private function fullScreen(evt:MouseEvent):void{               if (this.stage.displayState == StageDisplayState.FULL_SCREEN){                   this.stage.displayState = StageDisplayState.NORMAL;                   stage.scaleMode = StageScaleMode.NO_SCALE;                   fullscr.label = '全屏' ;               }else{                   this.stage.displayState = StageDisplayState.FULL_SCREEN;                   stage.scaleMode = StageScaleMode.NO_SCALE;                   fullscr.label = '退出全屏' ;               }           }                    ]]>    </mx:Script>        <mx:Canvas width="100%" height="6%" backgroundColor="#131A2C" backgroundAlpha="0.9">                <mx:Button id="fullscr" width="80" height="30" x="30" y="4" label="全屏模式" click="fullScreen(event)"/>        </mx:Canvas></mx:Application>

全屏报 “SecurityError:Error #2152:不允许使用全屏模式” 的错误。

是因为需要在修改FLex项目下html-template文件夹下的xxx.template.html文件:

在两个AC_FL_RunContent方法里加入:

"allowFullScreen", "true"

保存,收工。




原创粉丝点击