PDA

View Full Version : [AS3] TextField height


IanLiu
12-06-2006, 11:17 AM
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, 12:29 PM
http://livedocs.macromedia.com/flex/2/langref/flash/text/TextField.html#textHeight

regards.

IanLiu
12-06-2006, 12: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.

numediaweb
04-17-2009, 07:43 AM
what about my_txt.htmlText especially when the input text contains the <BR/> tags? :

my_txt.htmlText ="this is lot of text <BR><BR> and
<BR>another text containing <br>";

it doesn't work!