7 Replies Latest reply on Jan 16, 2007 2:16 AM by Shandy Elliott

    querry reg: TextFormat

    Level 7
      This is a multi-part message in MIME format.

      ------=_NextPart_000_006C_01C73413.42103590
      Content-Type: text/plain;
      charset="iso-8859-1"
      Content-Transfer-Encoding: quoted-printable

      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 =3D new TextFormat();
      my_fmt.blockIndent =3D 20;
      my_fmt.color =3D 0xFF0000; // hex value for red=20

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

      This is not working!=20

      But when i tried creating text field dynamically its working

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

      this.createTextField("my_txt", 1, 100, 100, 300, 100);
      my_txt.multiline =3D true;
      my_txt.wordWrap =3D true;
      my_txt.border =3D true;
      my_txt.text =3D "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.
      --=20
      BRegards
      Anup Pardasani
      ------=_NextPart_000_006C_01C73413.42103590
      Content-Type: text/html;
      charset="iso-8859-1"
      Content-Transfer-Encoding: quoted-printable

      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
      <HTML><HEAD>
      <META http-equiv=3DContent-Type content=3D"text/html; =
      charset=3Diso-8859-1">
      <META content=3D"MSHTML 6.00.5730.11" name=3DGENERATOR>
      <STYLE></STYLE>
      </HEAD>
      <BODY bgColor=3D#ffffff>
      <DIV><FONT face=3DArial size=3D2>hello all!</FONT></DIV>
      <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
      <DIV><FONT face=3DArial size=3D2>I would like to change the font colour =
      of a dynamic=20
      text =96 the text field is not generated using script. I have used this=20
      script:</FONT></DIV>
      <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
      <DIV><FONT face=3D"Courier New" color=3D#800000 size=3D2>var =
      my_fmt:TextFormat =3D new=20
      TextFormat();<BR>my_fmt.blockIndent =3D 20;<BR>my_fmt.color =3D =
      0xFF0000; // hex=20
      value for red </FONT></DIV>
      <DIV><FONT face=3D"Courier New" color=3D#800000 =
      size=3D2></FONT> </DIV>
      <DIV><FONT face=3D"Courier New" color=3D#800000 size=3D2>my_txt =3D =
      "this is my first=20
      test field object text";<BR>my_txt.setTextFormat(my_fmt);</FONT></DIV>
      <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
      <DIV><FONT face=3DArial size=3D2>This is not working! </FONT></DIV>
      <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
      <DIV><FONT face=3DArial size=3D2>But when i tried creating text field =
      dynamically=20
      its working</FONT></DIV>
      <DIV><FONT face=3DArial size=3D2></FONT> </DIV>
      <DIV><FONT face=3DArial size=3D2><PRE><FONT color=3D#800000 =
      size=3D3><FONT size=3D2>var my_fmt:TextFormat =3D new TextFormat();
      my_fmt.blockIndent =3D 20;
      my_fmt.color =3D 0xFF0000; // hex value for red=20

      this.createTextField("my_txt", 1, 100, 100, 300, 100);
      my_txt.multiline =3D true;
      my_txt.wordWrap =3D true;
      my_txt.border =3D true;
      my_txt.text =3D "this is my first test field object text";
      my_txt.setTextFormat(my_fmt);</FONT>
      </FONT></PRE></DIV>
      <DIV>Somebody please help me, i dont want the textfield to be created=20
      dynamically.<BR>-- <BR>BRegards<BR>Anup =
      Pardasani</FONT></DIV></BODY></HTML>

      ------=_NextPart_000_006C_01C73413.42103590--