1 Reply Latest reply on Mar 16, 2011 1:10 PM by Flex harUI

    How to force Application width

    Maximist Level 1

      Hallo. I need to change Application width dynamically but i have a little problem. If i have this code:

       

       

      <?xml version="1.0" encoding="utf-8"?>

      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

        xmlns:s="library://ns.adobe.com/flex/spark"

        xmlns:mx="library://ns.adobe.com/flex/mx" currentState="loading" xmlns:ns="componenti.Componenti_Condivisi.*" xmlns:ns1="componenti.Applicazione_Principale.*"

        currentStateChange="aStatoCorrenteCambiato(event)" width="780" height="950" initialize="initialize(event)">

       

       

       

      <s:Group id="myGroup" width="100%" height="100%"/>

       

       

       

      </s:Application>

       

       

      When i change the Application width from 780 to 700 everything inside myGroup is cut from 700 to 780 as it should be. The problem is that i need to do it dynamically and not inside mxml tags and when i do that with this code:

       

       

      <?xml version="1.0" encoding="utf-8"?>

      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

        xmlns:s="library://ns.adobe.com/flex/spark"

        xmlns:mx="library://ns.adobe.com/flex/mx" currentState="loading" xmlns:ns="componenti.Componenti_Condivisi.*" xmlns:ns1="componenti.Applicazione_Principale.*"

        currentStateChange="aStatoCorrenteCambiato(event)" width="780" height="950" initialize="initialize(event)">

       

       

       

      protected function initialize(event:FlexEvent):void

      {

       

       

           this.width = 700;

           this.height = 950;

       

       

      }

       

       

       

      <s:Group id="myGroup" width="100%" height="100%"/>

       

       

       

      </s:Application>

       

       

      All objects inside myGroup are not cut even if the Application is now 700 width. The objects inside myGroup go outside Application Space and that is not good.. Why this happen??.. What is the difference between changing width in mxml and changing width with as3??

       

      Thx for all

       

      Max