In Flex, how to make a window not mutable?

So, I am trying to open a second window, designed for a window with a fixed size. I set the resizable property to false, but this does not seem to have any effect.

here is my sample code

Main application

<?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, I expect TestWindow should not change. however, I can change it without any problems. Did I miss something?

0
source share
3 answers

Flash Builder 4.5, s:WindowedApplication not s:Window, ; "resizable".
, . :
http://www.actionscript-flash-guru.com/blog/16-code-for-a-resizable-window-in-as3

:
src HalloFlex-app.xml. :

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

, . !

+3

, . maximizable false, ...

+1

I'm not sure why this does not work, but you can try setting maxWidth, minWidth, maxHeight and minHeight.

0
source

Source: https://habr.com/ru/post/1706214/


All Articles