flex4获取当前窗口的长度与宽度的方法
之前为了实现flex网页自适应屏幕大小
看到网上的答案是
Application.application.width
Application.application.height
但是这是适用于<mx:Applicationg/>的,在flex4后,建议适用<s:Application/>,发现Application.application已经不存在了
this.stage.stageWidth
我做了一个登陆界面,没有用state而且做成组件PopUp新窗口,这样有利于以后反复应用,但是又想新窗口看上去像新的一页,于是就投机想让PopUp的窗口界面大小自适应屏幕。
我的做法是
<s:BorderContainerxmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:local="*" width="1366"height="768" preinitialize="loginPreinit()" initialize="loginInit()">
privatefunctionloginPreinit():void
{
this.width=this.stage.stageWidth;
this.height=this.stage.stageHeight;
}
这样PopUp的窗口也自适应屏幕大小了。
热门推荐
10 财运虎年祝福语简短语
11 单亲爸爸春节祝福语简短
12 狗狗上厕所训练
13 植物种植祝福语简短
14 翻译考试祝福语朋友简短
15 个人周年庆简短祝福语
16 狗狗怎么训练
17 分别祝福语简短搞笑英文
18 生日广州男生祝福语简短