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
fonttag (assuming it’s an html textfield).See documentation here.