0 Replies Latest reply on Jul 28, 2010 1:20 PM by flairjax

    Best way to set dynamic width

    flairjax Level 1

      I have a custom component that has some text fields in it (see below), which need to have variable lengths. I was wondering what is the best way to set the width so it is long enough, but not to long?

       

      <group id="main">

      <s:Group x="1">
                  <s:RichText color="#000000" fontFamily="Arial Bold" fontSize="11" kerning="on" tabStops="S0"
                              text="WAP:" trackingRight="0.5" x="5" y="11"/>
                  <s:RichText color="#000000" fontFamily="Arial Bold" fontSize="11" kerning="on" tabStops="S0"
                              text="VLAN:" trackingRight="0.5" x="5" y="50"/>
                  <s:RichText id="dyna" color="#000000" fontFamily="Arial" fontSize="11" kerning="on" tabStops="S0" width="{main.width - 5}" maxWidth="{main.width - 5}" maxDisplayedLines="1"
                              text="wap 1" trackingRight="0.5" x="47" y="11" textDecoration="underline" showTruncationTip="true"/>

      </s:Group>

      </group>

       

      I am thinking how I have it above will not work because "main" may not have a width set until "dyna" already has its width determined?

       

      TIA, J