Question

I have already googled and read a lot of different topics relating to this problem, but still cant solve mine. I have this dynamic text field in a movieclip, and I embeded upper case, lower case and numbers. I exported that movieclip, then used it in my class and it's loading data from xml.

However, after I embedded the bold fonts, it stopped displaying data from xml, if I use regular, it's fine. Then I created a font symbol and add the bold font in the library, it still doesn't give me anything.

Does anyone know how to solve this problem?

thanks.

Was it helpful?

Solution

The easiest way to fix this problem is to create a set of textfields off screen. Each field will handle the embedding for a single font and weight combination that you need. So, for example, if you need regular, bold, italic and both bold and italic for a single font, they you will have 4 textfields - each with embedding turned on, and the characters you need selected.

Then you can simply turn on font embedding for any other textfield and it will be able to use all four styles (of that font).

OTHER TIPS

I tried changing every instance to the embedded version font with no success. I WAS however, able to use the solution suggested on the Adobe Forum here:

http://forums.adobe.com/thread/716363

Instead of using myTextFieldInstance.text, use myTextFieldInstance.htmlText and specify "<b>" + yourStringValue + "</b>" during assignment. While kludgey to the max, it was an easy solution to the problem.

I assume you are using one of the recent versions of the Flash IDE.

Sounds to me like a conflict. If you have another text field in that Movie with the same font and weight but not set to the embedded font there would be a silent (and annoying) conflict. Solution is to make sure that all the text fields, including static and input are set to the font in the font list with the asterisk i.e. Arial*.

If this doesn’t fix it for you I suggest you should embed the font using the [embed] MXML tag (only cs4). Lee Brimelow has a great video tutorial on this technique you can watch it at gotoAndLearn.

I had some trouble with embedded fonts before and the embed tag fixed it for me. Have a look at my post and see if it helps.

There is definitely an issue with applying Bold type font.

The font is not set as BOLD with following code, if you dynamically update the text later on somewhere in the code.

var myTextFormat:TextFormat = new TextFormat();
myTextFormat.font = "Arial";
myTextFormat.bold = true;
myTextField.setTextFormat(myTextFormat);

//
myTextField.text = "some dynamic text";

Instead, you need to apply the text format each time you update the text.

var myTextFormat:TextFormat = new TextFormat();
myTextFormat.font = "Arial";
myTextFormat.bold = true;

//
myTextField.text = "some dynamic text";
myTextField.setTextFormat(myTextFormat);

But, i generally set it as default font as shown below,

var myTextFormat:TextFormat = new TextFormat();
myTextFormat.font = "Arial";
myTextFormat.bold = true;
myTextField.defaultTextFormat = myTextFormat;

//
myTextField.text = "some dynamic text";

Not a perfect way for robust project but it works.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top