Actionscript 3 AS3-打开多个/多个窗口+;检测系统上有多少屏幕
我想知道是否有可能创建一个air desktop应用程序,该应用程序在打开时检测连接到计算机的屏幕数量,在主屏幕上打开一个“控制器”窗口,在辅助屏幕上以全屏模式打开一个“演示”窗口Actionscript 3 AS3-打开多个/多个窗口+;检测系统上有多少屏幕,actionscript-3,flash,air,fullscreen,desktop,Actionscript 3,Flash,Air,Fullscreen,Desktop,我想知道是否有可能创建一个air desktop应用程序,该应用程序在打开时检测连接到计算机的屏幕数量,在主屏幕上打开一个“控制器”窗口,在辅助屏幕上以全屏模式打开一个“演示”窗口 目前,我发现的唯一解决办法是使用两个应用程序通过本地连接相互通信来检测空气中的屏幕数量: flash.display.Screen.screens.length //Screen.screens property is an array of all the screens on the system //yo
目前,我发现的唯一解决办法是使用两个应用程序通过
本地连接相互通信
来检测空气中的屏幕数量:
flash.display.Screen.screens.length //Screen.screens property is an array of all the screens on the system
//you can get things like the bounds, color depth etc
要从主窗口打开第二个窗口,请执行以下示例:
var myContent:Sprite = new Sprite(); //this would be whatever display object you want on the new window.
//SOME OPTIONAL WINDOW OPTIONS
var windowOptions:NativeWindowInitOptions = new NativeWindowInitOptions();
windowOptions.owner = stage.nativeWindow; //setting the owner to the main window means that if this main window is closed, it will also close this new window
windowOptions.renderMode = NativeWindowRenderMode.AUTO;
windowOptions.systemChrome = NativeWindowSystemChrome.STANDARD;
//Create the new window
var newScreen:NativeWindow = new NativeWindow(windowOptions);
newScreen.title = "My New Window";
newScreen.stage.addChild(content);
//the screen to put it on
var screen:Screen = Screen.screens[Screen.screens.length - 1]; //get a reference to the last screen
//move the new window to the desired screen
newScreen.x = (screen.bounds.left);
newScreen.y = (screen.bounds.top);
//focus the new window
newScreen.activate();
对于全屏,您可以最大化窗口,或进入flash的全屏模式:
newScreen.maximize();
newScreen.stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
您可以像处理任何其他显示对象一样处理窗口的内容。您可以在windows stage中添加任意数量的内容。非常感谢您的快速回答@LDMS。虽然我不能将主窗口设置为owner
windowOptions.owner=stage.nativeWindow代码>您提供给我的代码运行良好,是进一步调查的良好开端。你知道为什么我不能把它当作主人吗?PS:也谢谢你编辑我的问题