9 Replies Latest reply on Apr 4, 2010 6:38 PM by adamgeework

    How do I align my text to the LEFT in this custom component?

    adamgeework
      package {
           import mx.controls.LinkButton;
           import flash.text.TextLineMetrics;
       
           public class multiLineLinkButton extends LinkButton {
                override protected function createChildren():void {
                     super.createChildren();
                     if (textField){
                          textField.wordWrap = true;
                          textField.multiline = true;
                          
                     }
                }
       
                override public function measureText(s:String):TextLineMetrics {
                     textField.text = s;
                     var lineMetrics:TextLineMetrics = textField.getLineMetrics(0);
                     lineMetrics.width = 700;
                     lineMetrics.height = textField.textHeight;
                     
                     
                     return lineMetrics;
                }
           }
      }
      

      I found this component that wraps linkbuttons.

       

      When I use this component it makes it centered

      I tried autosize up top but it doesnt work here.