I am trying to set a portion of a textfield to a certain format (Red, size, etc). The formatting works for color, size, etc but when I try to add '.bold = true' to the format, it does not work. Does anyone know how to include a bold setting to a text format?
Code:
var textToBold:String = "";//This marks the text to highlight.
var startBoldText:int = 0;
var formatBoldText:TextFormat = new TextFormat("Times New Roman",15,0xFF0000);
formatBoldText.bold = true; //This does not work
Then when I need to use the format
Code:
if (originalString.search("______") >= 0)
{
originalString = originalString.split("______").join(evt.currentTarget.txtAnswer.text);
textToBold = evt.currentTarget.txtAnswer.text;
//trace("Trying to bold this: " + textToBold);
startBoldText = originalString.indexOf(textToBold);
targetArray[indexOfCurrentTarget].quesText.text = originalString;
targetArray[indexOfCurrentTarget].quesText.setTextFormat(formatBoldText, startBoldText, startBoldText + textToBold.length);
}