Posted By

chrisaiv on 11/08/07


Tagged

stylesheet styles as3


Versions (?)

Who likes this?

14 people have marked this snippet as a favorite

copyleft
sweetbabyyoung
Akuma99
outbox
visuallyspun
THEPWN3R
enajenkins
loric
TrentSkunk
djmaddy
tspitzr
adrianparr
kronda
elkraneo


AS3: Adding styles to a TextArea component using new TextFormat()


 / Published in: ActionScript 3
 

Confusing but here's the rule. TextFields can use stylesheets. TextArea or TextInput need a new TextFormat()

  1. var textAreaFormat:TextFormat = new TextFormat();
  2. textAreaFormat.size = 30;
  3. textAreaFormat.italic = true;
  4.  
  5. var ta:TextArea = new TextArea();
  6. ta.x = 100;
  7. ta.y = 100;
  8. ta.width = 300;
  9. ta.height = 300;
  10. ta.setStyle("textFormat", textAreaFormat);
  11. ta.htmlText = "This is text within a text area";
  12. addChild(ta);

Report this snippet  

You need to login to post a comment.