1 Reply Latest reply on Jan 12, 2007 1:11 AM by Marghoob Suleman

    font colour of a dynamic text

    Level 7
      hello all!

      I would like to change the font colour of a dynamic text - the text field is
      not generated using script. I have used this script:

      var my_fmt:TextFormat = new TextFormat();
      my_fmt.blockIndent = 20;
      my_fmt.color = 0xFF0000; // hex value for red

      my_txt = "this is my first test field object text";
      my_txt.setTextFormat(my_fmt);

      This is not working!

      But when i tried creating text field dynamically its working

      var my_fmt:TextFormat = new TextFormat();
      my_fmt.blockIndent = 20;
      my_fmt.color = 0xFF0000; // hex value for red

      this.createTextField("my_txt", 1, 100, 100, 300, 100);
      my_txt.multiline = true;
      my_txt.wordWrap = true;
      my_txt.border = true;
      my_txt.text = "this is my first test field object text";
      my_txt.setTextFormat(my_fmt);
      Somebody please help me, i dont want the textfield to be created
      dynamically.
      --
      BRegards
      Anup Pardasani

      --
      BRegards
      Anup Pardasani
      NewsLink Services (India)
      www.newslinkservices.com