Search code examples
actionscript-3apache-flexcolorstextinputflex-spark

Multiple text color in one spark:TextInput


How can I color words in spark:TextInput with two or more colors?

I did it with mx:TextInput with htmlText property but i can not find it in spark component.

Thanks


Solution

  • <s:TextArea id="txt_ar"  textAlign="justify"
    borderAlpha="0" editable="false">
    

    then write ur html string

    textrichtml:String = "your html string"
    

    then use following code.

    txt_ar.textFlow = TextConverter.importToFlow(textrichtml,TextConverter.TEXT_FIELD_HTML_FORMAT);