Sang Park
Sang Park

Reputation: 402

in Flex how do I make a window not resizable?

So I'm trying to open a second window that is meant to be a fixed size window. I've set resizable property to false but that doesn't seem to have any effect.

here's my sample code

Main app

<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" 
                       xmlns:s="library://ns.adobe.com/flex/spark" 
                       xmlns:mx="library://ns.adobe.com/flex/mx"
                       height="600"
                       creationComplete="onCreationComplete()">
    <fx:Script>
        <![CDATA[
            import foo.TestWindow;

            protected function onCreationComplete():void
            {
                var window:TestWindow = new TestWindow();
                window.open();
            }

        ]]>
    </fx:Script>
</s:WindowedApplication>

TestWindow

<?xml version="1.0" encoding="utf-8"?>
<s:Window xmlns:fx="http://ns.adobe.com/mxml/2009" 
          xmlns:s="library://ns.adobe.com/flex/spark" 
          xmlns:mx="library://ns.adobe.com/flex/mx" width="400" height="300"
          resizable="false">

    <s:Label text="this window should not be resizable" />
</s:Window>

When I run this code, my expectation is that TestWindow should not be resizable. however I can resize it without any problem. Am I missing something here?

Upvotes: 0

Views: 2428

Answers (3)

Badar
Badar

Reputation: 1460

I am using Flash Builder 4.5 and the root tag is s:WindowedApplication not s:Window as you said; and there is no property named 'resizable'.
While I was looking for a better solution, I just found this. Hope will help you:
http://www.actionscript-flash-guru.com/blog/16-code-for-a-resizable-window-in-as3

Here is a very simple solution:
Go to the src folder of your application and open HalloFlex-app.xml file. This is the app config file and make following adjustments to the maximizable and resizable properties in this file:

<maximizable>false</maximizable>  
<resizable>false</resizable>  

This way your app window will neither be resizable and nor be maximizable. Thanks!

Upvotes: 3

Sang Park
Sang Park

Reputation: 402

ok i figured it out. You need to also set maximizable property to false as well for this to work...

Upvotes: 1

James Ward
James Ward

Reputation: 29433

I'm not sure why that isn't working but you could try to set maxWidth, minWidth, maxHeight, and minHeight.

Upvotes: 0

Related Questions