2 Replies Latest reply on Oct 12, 2006 10:02 AM by ccaptainsubzero

    Losing Font in Dynamic Text Field

      I am working on a site where the layout must be fairly precise. I thought to accomplish the menu rollovers, using copperplate font, by laying out the menus in text (with proper spacing, dividers) and then putting invisible buttons over the areas that woudl be the links.

      I make a movie clip, with the dynamic text field in it, properly formatted, font and all, save it in the library, and then use clip.attachMovie() to load it to the stage during runtime. Worked great on my machine -- and on my client's. But we both have copperplate installed (and for what it's worth, we both have Macintosh). I looked at it on a Windows machine today -- the text had lost all formatting, and was no longer centered in the text box.

      What am I missing here? Have I somehow screwed with the text properties when I do the rollover as follows -- does doing this lose the text formatting? And then why does it work on my machine, and my client's -- i.e. why does the text in the dynamic field show up properly as copperplate?

      private function doMenuRoll(the_txt:TextField, startSel:Number, endSel:Number, over:Boolean):Void {
      var text_fmt:TextFormat = new TextFormat();
      if (over == true) {
      text_fmt.color = Constant.menu_roll;
      } else {
      text_fmt.color = Constant.menu_color;
      the_txt.setTextFormat(startSel, endSel, text_fmt);
        • 1. Re: Losing Font in Dynamic Text Field
          AnandMX Level 1
          put the_txt.embedFonts=true
          • 2. Losing Font in Dynamic Text Field
            ccaptainsubzero Level 1
            At what point would I do this? Do I need to embed the font when I put the textfield in the library at authoring time? I've got the TextField in my library, in a movieclip, in the authoring environment. I've now set up the proper font to export from my library (linkage, etc), and found the following instructions:

            to embed a font you must set the embedFonts property of your textformat object to true, you must assign its font property and you must link a font from your library so its linkage id matches the name you used in your font property.

            Do I do this in my script, or at author time? And how…?