Skip to main content
Participating Frequently
December 26, 2007
Question

Dynamic text and embedded font

  • December 26, 2007
  • 2 replies
  • 592 views
Hi,

I'm new to Flash and AS3, and I'm having a problem when I do the following: I create an empty dynamic text field in the authoring environment, click "Embed...", and choose the character sets that I want (I get the same results when I embed the entire font). The first time I change the contents of the text field with the command:

text_field.text = "string 1";

I get good results--the text appears in the correct font. However, subsequent attempts to update the .text property fail with no error message, and the field becomes blank.

If I remove the embedded font by clicking "Don't embed" in the embedding dialog, then every time I update the field's .text property, it displays correctly using a local machine font.

I've also tried embedding the font in the swf by creating a dynamic text field in the authoring environment, into which I place no text, creating a second, functional text field in actionscript, formatting it, using the "embed = true" property, and repeatedly updating the .text property with the same bad results as described above.

I haven't tried using the [embed] metatag to dynamically load the font.

I've tested the swf in IE7 and Firefox on two machines with the same results. What am I doing wrong?

Thanks,
Dave
This topic has been closed for replies.

2 replies

kglad
Community Expert
Community Expert
December 27, 2007
try to reproduce the problem in another fla.
Participating Frequently
December 27, 2007
Will do.
kglad
Community Expert
Community Expert
December 26, 2007
you probably have a different textfield instance on-stage with "subsequent attempts to update the .text property".
Participating Frequently
December 26, 2007
Hi. Thanks for your reply. Why would this be an issue only when the font is embedded? Again, with no embedded font, there's no problem.
Participating Frequently
December 26, 2007
Okay, here's more information. The font that I've been trying to embed is Bitstream Vera Sans Mono. If I embed a different font, like Bitstream Vera Sans, I have no problem. It seems to me that it must be that my Bitstream Vera Sans Mono is corrupted, my .fla and .swf files are corrupted, or there's a bug in flash...