Multiple windows in Adobe AIR

Is it possible to open multiple descriptor windows in a single Adobe AIR application? You can take a walk by letting the app be transparent, but I'm interested in a better solution.

+3
source share
3 answers

The following will do the trick (this is Theo's code slightly corrected):

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" applicationComplete="main()">
    <mx:Script>
    <![CDATA[
    import mx.core.Window;

    private function main( ) : void {
        var window:Window;
        for ( var i:int = 0; i < 5; i++ ) {
            window = new Window();
            window.width  = 200;
            window.height = 300;
            window.open(true);
            window.showStatusBar = false;
        }
    }
    ]]>
    </mx:Script>
</mx:Application>
+2
source

The best way to handle this is to make the main class a subclass Applicationinstead WindowedApplicationand set the initialWindow visiblevalue to the parameter false. Then in your main class you create as many instances Windowas you want.

Main class:

<Application xmlns="http://www.adobe.com/2006/mxml">
  <applicationComplete>main()</applicationComplete>
  <Script>
  <![CDATA[
  private function main( ) : void {
    var window : Window;
    for ( var i = 0; i < 5; i++ ) {
      window = new Window();
      window.width  = 200;
      window.height = 300;
      window.open(true);
    }
  }
  ]]>
  </Script>
</Application>

App config:

<application xmlns="http://ns.adobe.com/air/application/1.5">
  ...
  <initialWindow>
    ...
    <visible>false</visible>
  </initialWindow>
</application>
+6
source

, ?

PopupManager .

0

Source: https://habr.com/ru/post/1719221/


All Articles