0

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..

chiwangc
  • 3,566
  • 16
  • 26
  • 32

1 Answers1

0

Try using :

textArea.setStyle("fontSize",25);

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

Barış Uşaklı
  • 13,440
  • 7
  • 40
  • 66