header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
Jim
Points:0
Posts:0

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");




1
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;

2
Jim
Points: 0
Posts:0
8/8/2010 11:44:46 PM



But this is generating an error on my label.
access to undefined property autoSize.
why?

3
Ronald
Points: 430
Posts:0
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);


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 3+6 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions