htmlText not showing bold or italics font
Asked Answered
F

3

6

So I have a MovieClip asset with a dynamic textfield sitting inside of it. I export my .fla as a .swc to use within Flash Builder 4, and create instances of the asset with code, populating the text dynamically from XML.

My issue is that even though I have htmlText enabled, bold and italics tags don't appear to be working. I have a feeling it is because when I created the asset in Flash CS4, the text field makes you specify the font, and the subset of that to use (Regular, Bold, Oblique, etc).

Is there any way to get the htmlText to render bold and italics tags properly without having to completely rethink the way I'm creating all these fields?

Flagler answered 11/5, 2010 at 0:39 Comment(0)
P
1

Without seeing how you are formatting your htmlText, I am guessing that you are trying to use the

< bold > and < em > tags?

I had a lot of trouble with these myself. I solved the majority of issues by loading an external stylesheet and applying it to the htmlText TextField. However, there were times when I did not want to define an entire style for one or two instances of italic or bold text.

So, I found a simple solution by using the < span > tag and set the bold, or italics through the style property:

<span style="font-style:italic;">this is italic</span>

Hope this helps.

Politi answered 18/7, 2010 at 20:57 Comment(0)
L
3

Okay I found a good solution, you need to make sure that the Linkage settings for the embedded fonts are set to export for actionscript OR that that font is used in some textfield in the SWF, otherwise, Flash thinks that the font is not being used and just doesn't embed it.

Lupien answered 23/12, 2010 at 17:0 Comment(0)
P
1

Without seeing how you are formatting your htmlText, I am guessing that you are trying to use the

< bold > and < em > tags?

I had a lot of trouble with these myself. I solved the majority of issues by loading an external stylesheet and applying it to the htmlText TextField. However, there were times when I did not want to define an entire style for one or two instances of italic or bold text.

So, I found a simple solution by using the < span > tag and set the bold, or italics through the style property:

<span style="font-style:italic;">this is italic</span>

Hope this helps.

Politi answered 18/7, 2010 at 20:57 Comment(0)
H
0

I think it's worth noting that Flash wants the old and tags, according to the documentation.

http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/text/TextField.html#htmlText

Hebraize answered 10/6, 2011 at 15:14 Comment(1)
Also, if your font is split up into several files, you'll need to embed those other fonts too. For example, if I used Helvetiva Neue 45 Light, and I added <i> tags to parts of the dynamic text, then I would also have to embed Helvetica Neue 45 Light Italic (into another textfield) so that it's available to the Flash piece. Hope this helps someone.Hebraize

© 2022 - 2024 — McMap. All rights reserved.