problem in short - when the flash file reads text from a xml file, the font display is unclear. when the text is embedded in the flash, it appears clearly

problem in detail -

i would appreciate your help because i am unable to resolve this problem despite my best efforts. please see '~about.fla'. it has been decompiled from a swf file as the original source code was not available (can this be causing the problem?). the xml folder resides in the same folder as '~about.fla'. it contains 'about.xml'. you can download these files at

i discovered a problem - if you view 'about.swf' - when you click on 'history' link, you can see that the text is distorted. this text is read from the xml file. but is you click on the 'key people' link, you can see that the text appears perfectly. this text is embedded in the flash itself.

please help me to resolve this problem. thank you in advance for you time and efforts.

i have given the screenshots 'text is unclear.jpg' and 'text is clear.jpg' to further explain my query.

please tell me if i have explained my problem properly or further clarifications are needed.

Dani AI

Generated

This is almost never an XML parser problem — it’s a font/embedding and rendering mismatch between the static text that was compiled into the FLA and the dynamic TextField that receives XML. Two things are showing up in your symptoms: (1) the XML-loaded text is using a different rendering path (device font or a non‑embedded outline) so it looks fuzzy, and (2) the fact that text wrapped in <b> disappears after you embed Calibri means Flash doesn’t have a matching bold outline available for that field, so the HTML-style bolding can’t be rendered from the embedded data.

Practical checklist to fix it (works whether you use the IDE or code):

  • Recreate library font symbols for every style you use (Calibri Regular, Calibri Bold, etc.), mark them “Export for ActionScript” and embed an appropriate glyph set (or “all characters”) so numbers, punctuation and accented letters aren’t missing. ’s suggestion to use a library font is the right starting point — extend it by adding the bold/italic variants too.
  • Make the dynamic TextFields use embedded outlines (check Embed Fonts or set embedFonts = true) and use HTML text only via htmlText when the XML contains tags. If you want the <b> tag to work, the bold face must be embedded; as a temporary workaround you can use <font face="ExactEmbeddedFontName">...</font> where the face matches the library font name.
  • Improve crispness by using advanced anti-aliasing and pixel grid fitting (AntiAliasType.ADVANCED / GridFitType.PIXEL in code or “Anti‑alias for readability” in the IDE), avoid non-integer scaling of text fields and keep fields aligned to whole pixels.
  • If you decompiled the SWF, re-check the library: decompilers often lose embedded fonts or their export flags — re-embed the fonts into a fresh FLA and retest.

Quick tests: assign a short known string from XML to htmlText, toggle embedFonts on/off, and try both the regular and bold library fonts to confirm which variant is missing. If problems persist, verify the XML file encoding (use UTF‑8) and confirm the embedded font’s name exactly matches the name you use in <font face="..."> or TextFormat.

Recommended Answers

All 5 Replies

Member Avatar for Member #334542

Steps:

1. Rightclick emptyspace on the library and select "New Font"
2. Give a name and select your font, dont forget to give export in first frame, and for actionscript.
3.

var myFont = new Font1();
var myFormat:TextFormat = new TextFormat();
myFormat.size = 15;
myFormat.align = TextFormatAlign.CENTER;
myFormat.font = myFont.fontName;
var splashtxt:TextField = new TextField();
splashtxt.defaultTextFormat = myFormat;
splashtxt.embedFonts = true;
splashtxt.antiAliasType = AntiAliasType.ADVANCED;

The above is in ActionScript 3.0 make the relevant conversion to ActionScript 2.0

Hope this helps!

Member Avatar for Member #334542

font1 is the class name you given when you created font from the library

also if i try to embed the calibri font in the flash file, the font display is clear, but some parts of the text is simply not read from the xml file. please see the screenshots 'how i embed fonts.jpg', 'text without embedding fonts.jpg' and 'text after embedding fonts.jpg'. these are also available at
i later discovered that if you embed fonts, the text between <b> in the xml disappears, but text within <font> displays. can you throw some light on this? suppose i want to make some text in the xml bold, how do i achieve this without putting <b> in the xml? perhaps use css?
also when i embed fonts, why does it have to be done for each dynamic text field in the fla. whats the way to do it only once for each fla?

Member Avatar for Member #334542

Instead of bold tag, you just increase the size to 18.

<font color="#CC0000" size="18">History of Aaren Initiative</font>

for now!

Thanks for sharing.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.