1 Reply Latest reply on May 24, 2010 1:15 AM by David_F57

    Uisng the Percenate Facillity to place attributes inside Flex Framework .

    kiran7881 Level 1
      Hi ,


      This question is about placing the controls/components using the Percentage facility .


      From Adobe it is mentioned that :


      "You specify the component size as a percentage of its container size. To do this, you specify the percentHeight and percentWidth properties, or, in an MXML tag, set the height and width properties to percentage values such as 100%. "


      Can anybody tell me how is this approach different from the normal height and width of a Component ?? and


      How can we deteremine the percenategheight and percentagewidth for a component . For example in below example the author has taken as shown :


      <mx:HBox id="hBox1" xmlns:mx="http://www.adobe.com/2006/mxml"
      height="30%" width="90%"/>


      My question is how can we know that heights value and widths value should be 30 and 90 respectively ??


      Please let me know this , Thanks in advance .
        • 1. Re: Uisng the Percenate Facillity to place attributes inside Flex Framework .
          David_F57 Level 5



          The idea of percentages is that you dedicate that amount of the container to the component so if the container width is 200 and you have a left panel of 30% width it will be 60 pixels wide.


          You can also use a combination of percentage and fixed dimensions to keep parts of the screen static. For instance you have a menu on the left and a display area on the right, you set the left panel to width = 100 and the right panel to width = 100% so the right panel will always have a width that is equal to the total screen width-100;


          Percentages are just another way of managing component layout when there is no gaureantee of parent sizes such as different screen resolutions.