Search code examples
apache-flexpopupurlrequest

Flex: browser popup rather than Alert.show() type popup?


Im trying to create a browser popup window with some text, rather than using the Alert.show() or Flash Player level popups.

I have been looking around, and tried some stuff with URI Data Scheme, but thought one of you guys might have done something similar before.

UPDATE: Answered Myself Below


Solution

  • The following code does the trick:

    <fx:Script>
        <![CDATA[
            import flash.net.navigateToURL;
    
            private function urlJump():void{
    
                var url:URLRequest = new URLRequest("javascript:NewWindow=window.open(''," +
                    "'newWin','width=400,height=300,left=0,top=0,toolbar=No,location=No,scrollbars=No,status=No,resizable=No,fullscreen=No');  " +
                    "NewWindow.focus();void(0); " +
                    "NewWindow.document.write('hello');");
    
                navigateToURL(url, "_self" );
    
            }           
        ]]>
    </fx:Script>
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    
    <s:Button click="urlJump()" />