Skip to main content
Inspiring
April 26, 2009
Question

Bold a dynamic text box is not working...

  • April 26, 2009
  • 1 reply
  • 409 views

Dear Friends,

i neeed to create a text box with bold letter. my coding is as follows.

but it always shows bold, even i gave tf1.bold = false.

    reptitle.text = options[0][0].tit;
    var tf1:TextFormat = new TextFormat();
    tf1.color = options[0][0].col;
    tf1.size = options[0][0].siz;
    tf1.bold = options[0][0].bol;
    reptitle.setTextFormat(tf1);
    trace("bold :"+tf1.bold + " dat :"+options[0][0].bol);

Note: where options[0][0] is an array has all the properties bold = true/false, color = 0x----.

Any body can clarify me.. i got struct up..pls..

Thanks and Regards,

Syed Abdul Rahim

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
April 26, 2009

you'll need two textformat instances (one with bold enabled and one without) to display text with both bold and non-bold text at the same time with setTextFormat.  if you just want to change the text from bold to non-bold (and vice-versa), you can use one instance.