2 Replies Latest reply on Mar 22, 2007 6:26 PM by dbwalton

    setTextFormat

    dbwalton
      I have a move called termMovie, and in this movie is a dynamic text object named termWin. When I created this object, I set the color to 0x00ff00 (green). And, when I do something like...

      termMovie.termWin.txt = "Hello world.";

      it works.

      What I want to do is to change the color dynamically. Here's the code I've added to test if I can...

      myformat = new TextFormat();
      myformat.font = "Verdana";
      myformat.align = "left";
      myformat.size = 10;
      myformat.bold = true;
      myformat.color = 0x0080ff;
      termMovie.termWin.setTextFormat(myformat);

      It appears to do nothing.

      What am I missing here?
        • 1. Re: setTextFormat
          kglad Adobe Community Professional & MVP
          if the text property is assigned after the setTextFormat() it won't work. you must use setNewTextFormat().

          in addition, for both if you want to specify the font, you need to enable the embedFonts property of the textfield and you need to have a font in your library that has linkage id = Verdana.
          • 2. Re: setTextFormat
            dbwalton Level 1
            It turns out that the varialbes in the movie weren't being remember. So, I created them in the 1st scene of my movie as _global variables. Now it is working fine. I discovered this by setting a break point right after the set command, and the set command WAS working, but as soon as it left that movie, eventhough the text was still on the screen, it reverted back to the original color.