【发布时间】:2014-06-13 15:25:15
【问题描述】:
我正在用 HTML/JavaScript 构建一个 Adobe AIR 应用程序,它将使用两个窗口,其中一个窗口将显示在可用的最大屏幕上(如果可用)。
代码如下:
function showProjector(){
if(air.Screen.screens.length > 1) {
if(htmlLoader) {
// Projector is already shown
} else {
// Create a new window that will become the projector screen
var options = new air.NativeWindowInitOptions();
options.systemChrome = air.NativeWindowSystemChrome.NONE;
options.transparent = true;
options.type= air.NativeWindowType.LIGHTWEIGHT;
var htmlLoader = air.HTMLLoader.createRootWindow(false, options, false);
htmlLoader.window.nativeWindow.visible = true;
// Add content to new window
htmlLoader.load(new air.URLRequest('Projector.html'));
// Make the window appear on the biggest screen
htmlLoader.bounds = air.Screen.screens[1];
// Make it full screen
htmlLoader.stage.displayState = runtime.flash.display.StageDisplayState.FULL_SCREEN_INTERACTIVE;
}
} else {
// Show error that you need a projector screen
alert('You need a projector screen');
}
}
我已经处理了检查是否有多个屏幕可用以及投影仪是否已经显示的部件。但需要找出最大的屏幕并确保当前窗口不会移动到它,而新的htmlLoader 会移动到它。
我该怎么做?
【问题讨论】:
标签: javascript air