2014-11-03 6 views
0

열어봤을 때 컴퓨터에 연결된 화면의 양을 감지하고 하나를 열어 볼 수있는 에어 데스크톱 응용 프로그램을 만들 수 있는지 알고 싶습니다. 컨트롤러 "창과 보조 화면에서 전체 화면 모드의"프리젠 테이션 "창을 표시합니다.AS3 - 여러/여러 개의 창 열기 + 시스템에있는 화면 수 감지

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 

을 두 번째를 열려면 : 내가 찾은 유일한 작업 주위의 순간

은 AIR에서 화면의 양을 감지하기 LocalConnection

답변

1

를 통해 서로 통신이 애플 리케이션을하는 것입니다 기본 창에있는 창은 다음과 같습니다.

 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(); 

전체 화면의 경우 최대화하거나 플래시의 전체 화면 m ode :

 newScreen.maximize(); 
     newScreen.stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE; 

다른 표시 객체와 마찬가지로 창 내용으로 작업 할 수 있습니다. 원하는만큼 Windows 무대에 추가 할 수 있습니다.

+0

빠른 답변을 주셔서 대단히 감사합니다. @LDMS. 기본 윈도우를 소유자로 설정할 수는 없지만 'windowOptions.owner = stage.nativeWindow;'라고 입력하면, 제게 제공 한 코드가 제대로 작동하고 추가 조사가 시작됩니다. 소유자로 지정할 수없는 이유가 있습니까? 추신 : 내 질문을 수정 해 주셔서 감사합니다. – quasi