1 Reply Latest reply on Dec 9, 2006 10:28 AM by blemmo

    textformat problem

    blemmo Level 1
      Hi people,

      I want to have a custom selection color in an input textfield. The textfield is white text on a black background, so you can't see the selected text, because the selection color is also black.
      Now I tried to change the text color of the selected text, and it's kind of working, but it uses some other colors than I want. Here's the code I used:
      --
      var tf1:TextFormat = new TextFormat();
      tf1.font = "vera";
      tf1.size = 8;
      tf1.color = 0xFF0000;
      var tf2:TextFormat = new TextFormat();
      tf2.font = "vera";
      tf2.size = 8;
      tf2.color = 0x0000FF;
      var mc = createEmptyMovieClip("selectionChecker", getNextHighestDepth());
      mc.onEnterFrame = function() {
      chat_txt.setTextFormat(tf1);
      chat_txt.setTextFormat(Selection.getBeginIndex(), Selection.getEndIndex(), tf2);
      };
      --
      As you see, the text has red color (tf1), and the selected text is supposed to change to blue (tf2). However, the selected text appears white. When I change tf1 to white and tf2 to red, the selected text stays white. What's the problem here?

      greets,
      blemmo