ActionScript 3 TextArea htmlText style using <span> tag
According to this web page , the htmlText property on the TextArea can handle CSS text styling if a span tag is used. I want to format multiple tags in my code. Something like:
var tags:TextArea = new TextArea();
tags.htmlText = "<span style='color: rgb(165, 150, -90);
font-size: 0.955882610016677em'>street</span>,
<span style='color: rgb(168, 143, -59); font-size: 0.98076913067067em'>
motor</span>";
This only gives me a simple text. I was wondering if this is supported in the htmlText property and how would I get around it. Any ideas? Thank!
source to share
htmlText
supports only a limited set of tags and styles . In particular, span only supports the attribute class
, which must be the name of the class specified in the objectStyleSheet
.
You can use a tag font
in this particular case. But remember that color only supports hex values #ffffff
and size
only supports absolute pixel sizes and relative values (+2, -1, etc.).
tags.htmlText = "<font color="#a89433" size="10">street</font>,
<font color="#b37620" size="11">motor</font>";
source to share
http://github.com/theflashbum/fcss/
Directly answering your question, but you should check out this project. The CSS support in AS3 is terrible, F * CSS alleviates some of that pain.
source to share