1 Reply Latest reply on Oct 19, 2010 10:14 PM by Flying Dreamer

    Bold and italic fonts in dynamic text fields.

      I have a dynamic text field with the text "IMAGES". The font is Arial, it has BOLD and ITALIC checked, and has basic Latin fonts embedded. Now, I use Actionscript to change the text:

      textField.text = "IMAGES";

      Suddenly the text disappears! Now, it seems to me that since BOLD and ITALIC are checked on the text field, changing the .text value should simply change the text itself, which should then be rendered in bold and italic, and since I have bold+italic Latin glyphs embedded, it should display properly. But what's clearly happening is that when I set the text using Actionscript, it is attempting to display the NORMAL font instead, and since it's not embedded, it won't display. I know this because if I create another proxy text field off the screen and embed the NORMAL Arial glyphs, the original text field's text will display just fine - as normal-weight text.

      But why is this? Do I have to use a TextFormat object to set the text to Bold and Italic EVERY time I want to dynamicaly change the text? This seems silly. I simply want my text field to be bold and italic every time the text changes, and NO normal text!

      Any ideas?
        • 1. Re: Bold and italic fonts in dynamic text fields.
          Flying Dreamer

          I met the same problem using ActionScript3 and Flash Professional CS5. There are two problems with dynamic TextFields:


          - When you set style "Bold" for a text field in CS5, the "bold" property is not available in the TextField object in ActionScript, its defaultTextFormat.bold is alway false; I don't know if we can get this property anywhere else.


          - When you change the text of the dynamic TextField object, its style changes to normal no matter whether it was bold previously.


          This is really a bug in TextField, Adobe should fix this to implement TextField in an expected way.