How to open real popup window in Flex

airapache-flexpopupwindow

I need to open popup window in my flex / air application that will be displayed like normal application window. All I could manage is to open a window which is displayed inside my main flex window.

Is it something like that possible, and is there some workarounds if not?

Best Answer

You'll have to use a NativeWindow for that. More info the API docs: http://livedocs.adobe.com/flex/3/langref/flash/display/NativeWindow.html

import flash.display.NativeWindowInitOptions;
import flash.display.NativeWindowSystemChrome;
import flash.display.NativeWindowType;
import flash.display.NativeWindow;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.geom.Rectangle;

var windowOptions:NativeWindowInitOptions = new NativeWindowInitOptions();
windowOptions.systemChrome = NativeWindowSystemChrome.STANDARD;
windowOptions.type = NativeWindowType.NORMAL;

var newWindow:NativeWindow = new NativeWindow(windowOptions);
newWindow.stage.scaleMode = StageScaleMode.NO_SCALE;
newWindow.stage.align = StageAlign.TOP_LEFT;
newWindow.bounds = new Rectangle(100, 100, 800, 800);

newWindow.activate();
Related Topic