在as3中设置窗口初始宽度和高度

发布于 2024-12-27 10:17:38 字数 181 浏览 4 评论 0原文

我正在开发 Flex 移动应用程序,我想在 as3 中设置初始窗口宽度和高度。当我的应用程序在桌面上运行时,我想检测屏幕分辨率并将其设置为窗口边界,类似这样 this.width = Capability.screenresolutionX this.height = Capability.screenresolutionY

谢谢

I am working on a Flex mobile application and I want to set initial windows width and height in as3. When my app runs on Desktop, I want to detect screen resolution and set it to windows bounds, something like that
this.width = Capabilities.screenresolutionX
this.height = Capabilities.screenresolutionY

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

jJeQQOZ5 2025-01-03 10:17:38

您可以将 NativeWindow 的宽度和高度属性设置为 Capabilties.screenResolutionX 和 Capability.screenResolutionY

public function AppWindow()
{   
    var options:NativeWindowInitOptions = new NativeWindowInitOptions();
    options.systemChrome = NativeWindowSystemChrome.STANDARD;
    options.type = NativeWindowType.NORMAL;
    super(options);
    width = Capabilities.screenResolutionX;
    height = Capabilities.screenResolutionY;
    // to make sure content doesn't scale and aligns to top left set stage properties
    stage.align = StageAlign.TOP_LEFT;
    stage.scaleMode = StageScaleMode.NO_SCALE;

}

You can set the width and height properties of a NativeWindow to Capabilities.screenResolutionX and Capabilities.screenResolutionY

public function AppWindow()
{   
    var options:NativeWindowInitOptions = new NativeWindowInitOptions();
    options.systemChrome = NativeWindowSystemChrome.STANDARD;
    options.type = NativeWindowType.NORMAL;
    super(options);
    width = Capabilities.screenResolutionX;
    height = Capabilities.screenResolutionY;
    // to make sure content doesn't scale and aligns to top left set stage properties
    stage.align = StageAlign.TOP_LEFT;
    stage.scaleMode = StageScaleMode.NO_SCALE;

}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文