I have this function:
private function boldVerb(_phrase:String, _verb:String):String
{
var newHtmlText:String = "";
var pattern:RegExp = new RegExp([_verb]);
newHtmlText = _phrase.replace(pattern, "<b>" + _verb + "</b>");
return newHtmlText;
}
And I want to change the color of this "verb" that the function receives. Is it possible in AS3?
Sure. You can either use a stylesheet or you use the font
tag (assuming it's an html textfield).
<font color='#FF0000'>This is red</font>
See documentation here.