Search code examples
androidactionscript-3flex-mobile

FlexMobileProject, setStyle("textFormat",number) in textArea doesn't work


I create dynamic TextArea in Flex, I want to change its fontSize dynmically, but setStyle doesn't work.

This is my code:

var textArea:TextArea = new TextArea();  
textArea.id = "txtCreaTaskAnalysis" +contatoreNumeroTextAreaCreaTaskAnalysis;  
textArea.left = 140;  
textArea.right = 45;  
textArea.horizontalCenter = 47;  
textArea.height = 110;  
textArea.y = posizioneYTextArea;  
var tfor:TextFormat = new TextFormat();  
tfor.size= 25 ;  
textArea.setStyle("textFormat",tfor);  
textArea.text = tfor.size.toString();  
addElement(textArea);

I have this code in a buttonClickHandler, but the fontSize doesn't change.

Help, please..


Solution

  • Try using :

    textArea.setStyle("fontSize",25);
    

    I don't think TextArea has a style called "textFormat".