There is a problem with using the Bold font.
The font is not set to BOLD with the following code if you dynamically update the text later somewhere in the code.
var myTextFormat:TextFormat = new TextFormat(); myTextFormat.font = "Arial"; myTextFormat.bold = true; myTextField.setTextFormat(myTextFormat);
Instead, you need to apply a text format every time you update the text.
var myTextFormat:TextFormat = new TextFormat(); myTextFormat.font = "Arial"; myTextFormat.bold = true;
But I usually set it as the default font, as shown below,
var myTextFormat:TextFormat = new TextFormat(); myTextFormat.font = "Arial"; myTextFormat.bold = true; myTextField.defaultTextFormat = myTextFormat;
Not an ideal way for a reliable project, but it works.
Rajneesh gaikwad
source share