views:

37

answers:

2

From what I can gather, the resize property of a Flex application is set in the XML config file:

<!--Whether the user can resize the window. Optional. Default true.-->
<!--<resizable></resizable>-->

However, if I set this attribute to true, is there a way to turn this off dynamically at runtime? For example, my application has two view modes - mini and maxi. I would like to prevent the end user from being able to resize the application when in mini mode. I tried prevent the resize using the following code but it does not seem to work:

private function creationComplete():void {
    this.systemManager.stage.addEventListener(Event.RESIZE, resizeListener);
}

private function resizeListener(evt:Event):void {
    evt.preventDefault();
}

Any help would be greatly appreciated.

A: 

According to manual, resizable is read-only property. So it's probably not possible.

DoubleThink
+1  A: 

You'd need to create a new NativeWindow instance and reparent your application into that. When you create a new NativeWindow, you've got options you can set at Initialisation time, including resizable. http://help.adobe.com/en_US/FlashPlatform//reference/actionscript/3/flash/display/NativeWindowInitOptions.html

Gregor Kiddie
Hi, thanks for the link. This is probably what I was looking for. Do you have some sample code I could use to move between mini mode and maxi mode (and vice versa) where mini is not resizeable and maxi is?
Craig
Craig