PDA

View Full Version : autoSize not working



gykz
October 7th, 2008, 05:00 AM
Hi,

Once again text and as3 is a nightmare.

Could anyone please check this and tell me why text doesn't wrap at all but when I force a \n ?


var format:TextFormat = new TextFormat;
format.font = "Gotham";
format.size = 11;
format.color = 0x735322;

tf = new TextField();
tf.width = 150;
tf.embedFonts=true;
tf.antiAliasType = AntiAliasType.ADVANCED;
tf.text = _nom + "\n" + "("+_cd+") "+_duracio;
tf.setTextFormat(format);
tf.autoSize=TextFieldAutoSize.LEFT;
tf.selectable = false;

Thanks a lot

kipty
October 7th, 2008, 06:23 AM
make sure you have
tf.multiline = true;

gykz
October 7th, 2008, 07:18 AM
Thanks but neither that worked


make sure you have
tf.multiline = true;

kipty
October 7th, 2008, 07:35 AM
add
tf.wordWrap = true;

hopefully that should do it

gykz
October 8th, 2008, 04:24 AM
hey! that worked pretty good!
Thanks a lot.

I've been dealing with textfields, embeded fonts and as3 these days and I finally lost my point.


add
tf.wordWrap = true;

hopefully that should do it