views:

5484

answers:

3

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?

+4  A: 

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();
Christophe Herreman
+3  A: 

For a Flex application, you'll want to use mx.core.Window. For a non-Flex ActionScript application, you should use flash.display.NativeWindow.

joshtynjala
Thanks, mx.core.Window did the trick.
Dev er dev
+1  A: 

There is a good example here for flex 3.

Vikas