[AS3]as3获得客户端的分辨率源代码示例
[AS3]as3获得客户端的分辨率源代码示例,screenResolutionX 和screenResolutionY 属性返回桌面的显示分辨率
screenResolutionX 和screenResolutionY 属性返回桌面的显示分辨率:
trace(flash.system.Capabilities.screenResolutionX); // 1024
trace(flash.system.Capabilities.screenResolutionY); // 768
- package {
- import flash.display.Sprite;
- import flash.external.ExternalInterface;
- import flash.system.Capabilities;
- public class Sample1101 extends Sprite
- {
- public function Sample1101()
- {
- var screenX:int = flash.system.Capabilities.screenResolutionX;
- var screenY:int = flash.system.Capabilities.screenResolutionY;
- var winW:int = 200;
- var winH:int = 200;
- var winX:int = (screenX / 2) - (winW / 2);
- var winY:int = (screenY / 2) - (winH / 2);
- var jsCode:String = "javascript:void(newWin=window.open('http://www.CuPlayer.com/'," +
- "'newWindow', 'width=" + winW +
- ", height=" + winH + "," +
- "left=" + winX + ",top=" + winY + "'));";
- ExternalInterface.call(jsCode);
- }
- }
- }
热门文章推荐
- [HLS]做自己的m3u8点播系统使用HTTP Live Streaming(HLS技术)
- [FMS]FMS流媒体服务器配置与使用相关的介绍
- [AS3]什么是M3U8,与HTML5的区别是什么
- AS2.0 让flash自适应全屏,并且不自动缩放
- [AS3]as3.0的sound类常用技巧整理
- [AS3]as3与ByteArray详解、ByteArray介绍、ByteArray用法
- 关于RTMP,RTMPT,RTMPS,RTMPE,RTMPTE协议的介绍
- [JS]分享浏览器弹出窗口不被拦截JS示例
请稍候...