In Flex 3.2, I create a UITextField and then measure the text that I am going to assign to this property of the text field. Then I use these metrics to set the size of the field. However, the estimated width is not wide enough to fit the text. Is there a different order to achieve the correct measurement, or am I seeing a problem with the measureText () function? How can I get accurate results?
var tf:UITextFormat = uiTextField.getUITextFormat();
var tlm:TextLineMetrics = tf.measureText(this.labelText);
uiTextField.width = tlm.width + 9;
uiTextField.height = tlm.height + 4;
uiTextField.border = true;
uiTextField.name = "uiTextField";
uiTextField.text = this.labelText;
user56512
source
share