Skip to main content
June 22, 2010
Answered

Issues with dynamic text box formatting

  • June 22, 2010
  • 2 replies
  • 2394 views

I'm running into issues with using HTML formatting for a dymanic text field. I know these are quirky and I cannot figure out how to get the formatting proper.

I have on my stage a dynamic text box called "content_txt" inside of a movie clip instance "content_mc". When it enters the frame, I fade the "content_mc" from alpha 0 to 100 using a timeline animation. In order for this to work, I have to embed the font in my "content_txt" text field. However, the only way I get get the HTML formatting to work is if I do not embed the font.

The dymanic text field is set to render as HTML. In my actions layer, I set the text:

this.content_mc.content_txt.htmlText = "<b>Hello world,</b> it is me again."

In summary:

1. If I do not embed the font, the alpha fade does not work but the HTML formatting does.

2. If I embed the font, the alpha fade works but the HTML formatting does not.

How do I resolve this? It's driving me nuts!

This topic has been closed for replies.
Correct answer kglad

then you didn't follow d's instructions.

you should have two textfields.  the one on-stage that you started with and that embeds your regular (non-bold) font.  and one off-stage that embeds the same font family with bold enabled.  retest.

2 replies

June 22, 2010

There are different ways to do it - but try this - make a copy of your text field. Place it off stage. Change the style to Bold - same Family...

The HTML should work then.

kglad
Community Expert
Community Expert
June 22, 2010

(and embed that bold font.)

June 22, 2010

How do you embed just one style?

I've tried typing three words in the text field and formatting each (regular, bold, italic) but the text field just defaults to whichever format is first.

Also, I tried embeding the whole character list and did not have success.

kglad
Community Expert
Community Expert
June 22, 2010

you need to embed the regular font and you need to embed the bold font.