1 Reply Latest reply on Apr 11, 2012 6:55 AM by Patel Bharat

    How to dynamically resize a Spark Label?

    FrankD272389

      If i set the text of a spark label at runtime, the label dont resize automatically. How can i resize the correct width of a spark label at runtime?

       

       

      Thanks in advance

        • 1. Re: How to dynamically resize a Spark Label?
          Patel Bharat Level 2

          The sample will be helpful to you:

            

          <fx:Script>

                  <![CDATA[

                      protected function button1_clickHandler(event:MouseEvent):void

                      {

                          // TODO Auto-generated method stub

                         

                          lbl.text = lbl.text + " hi ";

                      }

                  ]]>

              </fx:Script>

           

              <fx:Declarations>

                  <!-- Place non-visual elements (e.g., services, value objects) here -->

              </fx:Declarations>

             

              <s:Label id="lbl" height="20" text="hello" backgroundColor="#FFcc12" x="157" y="83"/>

             

              <s:Button label="ok" click="button1_clickHandler(event)"  x="177" y="152"/>