Search code examples
apache-flexair

Adobe AIR: How do I bring NativeWindow in front of modal dialog?


I have a native window which opens up a url. That window is launched from a hyperlink present on a modal dialog. Native window always appears behind the modal dialog.

how can bring native window in front of the modal dialog.


Solution

  • set alwaysInFront property to true

       <?xml version="1.0" encoding="utf-8"?>
        <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
                               xmlns:s="library://ns.adobe.com/flex/spark" 
                               xmlns:mx="library://ns.adobe.com/flex/mx"
                               creationComplete="creationCompleteHandler(event)">
            <fx:Script>
                <![CDATA[
    
                    import mx.events.FlexEvent;
    
                    protected function creationCompleteHandler(event:FlexEvent):void
                    {
                        nativeWindow.alwaysInFront = true;
                    }
    
                ]]>
            </fx:Script>
    
        </s:WindowedApplication>