0
votes

I'd like to create a window which is not allowed to move. Is this possible?

4

4 Answers

1
votes

You just create a NativeWindow with it's systemChrome property set to NativeWindowSystemChrome.NONE. That way there is no possibility to move the window by native methods (dragging the title bar, etc.).

0
votes

You need to make sure these are set in your application.xml

<systemChrome>none</systemChrome>
<minimizable>false</minimizable>
<maximizable>false</maximizable>
<resizable>false</resizable>

Otherwise on windows you can hit the windows key + arrow to minimise / move the window around.

0
votes

You might also set NativeWindow.x/y to same value in ENTER_FRAME for example.

0
votes

Alternatively, if you want to still have the system Chrome and everything, you can listen for the NativeWindowBoundsEvent that you don't want (NativeWindowBoundsEvent.MOVE, RESIZE, etc) and make a listening function like this...

private function onWindowBoundsChange(evt:NativeWindowBoundsEvent):void {
    evt.preventDefault();
}

That way, you could turn it on or off whenever you want.