让Flex程序全屏幕运行
发布时间:2020-12-15 03:32:15 所属栏目:百科 来源:网络整理
导读:?xml version="1.0" encoding="utf-8"?mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" applicationComplete="init()"mx:Script![CDATA[import flash.display.StageDisplayState;import mx.managers.SystemManager;import flas
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" applicationComplete="init()"> <mx:Script> <![CDATA[ import flash.display.StageDisplayState; import mx.managers.SystemManager; import flash.events.FullScreenEvent; private function init():void { /* Set up full screen handler. */ systemManager.stage.addEventListener(FullScreenEvent.FULL_SCREEN,fullScreenHandler); dispState = systemManager.stage.displayState; } private function fullScreenHandler(evt:FullScreenEvent):void { dispState = systemManager.stage.displayState + " (fullScreen=" + evt.fullScreen.toString() + ")"; if (evt.fullScreen) { /* Do something specific here if we switched to full screen mode. */ } else { /* Do something specific here if we switched to normal mode. */ } } private function toggleFullScreen():void { try { switch (systemManager.stage.displayState) { case StageDisplayState.FULL_SCREEN: /* If already in full screen mode,switch to normal mode. */ systemManager.stage.displayState = StageDisplayState.NORMAL; break; default: /* If not in full screen mode,switch to full screen mode. */ systemManager.stage.displayState = StageDisplayState.FULL_SCREEN; break; } } catch (err:SecurityError) { // ignore } } ]]> </mx:Script> <mx:String id="dispState" /> <mx:Label text="width={Application.application.width}" /> <mx:Label text="height={Application.application.height}" /> <mx:Label text="displayState={dispState}" /> <mx:Button label="Toggle fullscreen" click="toggleFullScreen()" /> </mx:Application> 然后修改生成的html文件: AC_FL_RunContent(添加全屏配置参数 "allowFullScreen","true", 注:Flex4中不需要修改html文件 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- ruby-on-rails – 语法错误,意外的tIDENTIFIER,期待keyword
- 10.2 Swift方法的参数名称
- ruby-on-rails – Rails 3中的环境特定路由
- ruby-on-rails – 如何阻止当前请求的Rails调试器
- ASP.NET(C#)实现一次性动态上传多张图片的代码(多个文件)
- ajax 执行成功后返回j页面加载 joson 数据(加载select数据
- WebLogic部署异常问题weblogic.descriptor.DescriptorExcep
- ruby-on-rails – 如何在Rails中使用Ruby中的外部API
- 用Newtonsoft将json串转为对象的方法(详解)
- c# – 使用WebAPI时停止XSS