1 Reply Latest reply on Jul 18, 2008 10:36 AM by Rothrock

    how to apply multiple colors to dynamic textfield?

    chrisatflash Level 1
      Hello,
      I have to buttons on my stage called: button1_btn and button2_btn.
      When you press on it, the color parameter is passed to the makeText function.

      What i would like it to do, is when you press on button 1, a text is added to the dynamic
      textfield debug_txt with the color that is passed. And when you press the button 2, the
      text that was added in the first place stay's this color. And another sentence is added with
      the color that is passed trough button2.

      But what i created does not work.. Does anybody have experience with this?

      This is the code i have so far:

      function makeText(inputColor) {
      var fmt:TextFormat = new TextFormat();
      fmt.color = inputColor;
      debug_txt.text += "this text should be changed to the input color?"+newline;
      debug_txt.setTextFormat(fmt);
      }


      button1_btn.onPress = function() {
      makeText("0xFF0000");
      }
      button2_btn.onPress = function() {

      makeText("0xCCCCCC");
      }




      Regards,