PDA

View Full Version : [AS3] TextField height


IanLiu
12-06-2006, 12:17 PM
How do I predict the TextField height? When I initiate one, it comes with 100 height, but I want to set it to the fonts height.

I have tried the autoSize, but some times it shrinks the text field to a very tiny one, and some times it stays at fonts height, but I can't set its width anymore...

Is there a solution to this problem?

Thanks,
Ian Liu.

Dazzer
12-06-2006, 01:29 PM
http://livedocs.macromedia.com/flex/2/langref/flash/text/TextField.html#textHeight

regards.

IanLiu
12-06-2006, 01:59 PM
Hmm,
this assumes that your text got a text inside it. So, I would do this, right?

my_txt.text = "Some text";
my_txt.height = my_txt.textHeight;
my_txt.text = "";


Not very elegant... but thanks!
I will try it.