首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 媒体动画 > flex >

关于获取Flex Mobile荧屏宽高

2012-09-20 
关于获取Flex Mobile屏幕宽高1. mobile width and height import flash.display.Screenimport flash.syst

关于获取Flex Mobile屏幕宽高

1. mobile width and height

 

import flash.display.Screen;

import flash.system.Capabilities;

 

trace(Capabilities.screenResolutionX, Capabilities.screenResolutionY, Capabilities.screenDPI);

 

trace(Screen.mainScreen.bounds.width, Screen.mainScreen.bounds.height);

 

trace(stage.fullScreenWidth, stage.fullScreenHeight);

 

2. topLevelApplication width and height

 

var application:UIComponent = FlexGlobals.topLevelApplication as UIComponent;    

 trace(application.width, application.height);

 

3. actionBar width and height

trace(FlexGlobals.topLevelApplication.actionBar.width, FlexGlobals.topLevelApplication.actionBar.height);

 

4. task bar width and height

trace(Screen.mainScreen.bounds.width, Screen.mainScreen.bounds.height);

trace(Screen.mainScreen.visibleBounds.width, Screen.mainScreen.visibleBounds.height);

trace(Screen.mainScreen.bounds.height - Screen.mainScreen.visibleBounds.height);

 

5. portrait -> landscape

var appUIComponent:UIComponent = FlexGlobals.topLevelApplication as UIComponent;

var Width:Number = Math.ceil(appUIComponent.width / Capabilities.screenResolutionX * Capabilities.screenResolutionY);

var Height:Number = appUIComponent.width;

热点排行