8/8/2010 8:21:07 AM
Title:
Label autosize
How to autosize a label.Also I have a code to change the font size of label but not working why?
lbl.setStyle("fontsize","20");
Rayan
Points: 700
Posts:0
8/8/2010 9:57:00 AM
use proper case to set style flash is case sensitive "fontSize"
set the autoSize property of label to make label resize with content
label.autoSize = TextFieldAutoSize.LEFT;
8/8/2010 11:44:46 PM
But this is generating an error on my label.
access to undefined property autoSize.
why?
8/9/2010 1:52:22 AM
whats the need to autosize in flex label , its by default auto sizing if you don't give it width. In flash you can use
import fl.controls.Label;
var myLabel:Label = new Label();
myLabel.text = "This is a text displayed in autoSize label";
myLabel.autoSize = TextFieldAutoSize.LEFT;
myLabel.move(100, 100);
addChild(myLabel);