0 Replies Latest reply on Sep 17, 2010 8:17 PM by vunnikri

    Selective Text Color for Mx Controls.

    vunnikri

      Incase you are wondering how to color selective text in an mx control, here is how.

       

      STEP 1 : Use the htmltext property of the mx:TextArea

       

      <

       

      mx:Canvas label="Log" width="100%" height="100%">

       

      <mx:TextArea id="recoveryLog" htmlText="{parentApplication.model.request.log}" width="100%" height="100%" editable="false" />

       

      </mx:Canvas>

       

      STEP 2 : Generating color in text

       

      Here, the log is generated from Java Code.

       

      In order to use color, use your normal html tags.

       

      if

       

       

      (command.getError() != null && command.getError() != "")

      {

      sb.append(

      "<b><font color=\"#FF0000\">\n Error : " + command.getError() + "</font></b>" );

      }