简体   繁体   English

如何在Flash项目as3中设置Flash Player窗口位置?

[英]How to set Flash Player window location in Flash project as3?

I have 2 monitors on my computer, also am writing a program on AS3 that is exported to standalone SWF . 我的计算机上有2台显示器,也正在AS3上编写一个导出到独立SWF My task is to make my app fullscreen on 2nd screen. 我的任务是在第二个屏幕上全屏显示我的应用程序。 How can I do this? 我怎样才能做到这一点?

I tried converting my project to AIR project. 我尝试将我的项目转换为AIR项目。 It is possible there by using nativeWindow property of Stage . 通过使用Stage nativeWindow属性是可能的。 (setting x coordinate so that it appears in second screen and then call fullscreen). (设置x坐标使其显示在第二个屏幕中,然后调用全屏)。 It works in Flash, but when I'm running compiled swf outside Flash, my app crashes (nativeWindow property not found). 它适用于Flash,但是当我在Flash外部运行编译的swf ,我的应用程序崩溃了(找不到nativeWindow属性)。

So please do help me to solve my problem. 所以请帮我解决我的问题。 I am disappointed, have been looking for solution for already 3 days... 我很失望,一直在寻找已经3天的解决方案......

You have to stick with your AIR application and use it as it is supposed to: run the .air file. 您必须坚持使用AIR应用程序并按原样使用它:运行.air文件。 You can't launch an AIR swf alone because it will miss all the AIR runtime including the NativeWindow you are insterested in. 您无法单独启动AIR swf,因为它将错过所有AIR运行时,包括您感兴趣的NativeWindow

To be clear, you can't manipulate windows from a swf launched with the Flash Player. 要清楚,您无法使用Flash Player启动的swf操作窗口。

Another solution would be to execute your swf from a web browser and use javascript called through ExternalInterface to move the windows. 另一个解决方案是从Web浏览器执行您的swf并使用通过ExternalInterface调用的javascript来移动窗口。 But it may be quite painful in comparison with AIR. 但与AIR相比,这可能会非常痛苦。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM