how to append an event property with tlf html format inside a string

83 views Asked by At

im trying to update my sscript to to the flex 4 sdk

in sdk 3 it looked like this

    textarea.text += "<font color='#fff0000'><b>" + evt.user_message + "</b></font>";

defines the text property of the text area with the user message property of the event and html formats it but i want to do this in flex 4 so i instead defined a string as it and passed it through the converter to the text flow.

var d:String = <font color='#fff0000'><b> evt.user_message </b></font>;
chat_txt.textFlow = TextConverter.importToFlow(d, TextConverter.TEXT_FIELD_HTML_FORMAT);

this works except it just formats the word "evt.user_message" instead of formatting the property of evt.user_message. help :(

1

There are 1 answers

0
Josh On BEST ANSWER

That shouldn't work at all. d is not a string. You need to encapsulate it with quotes. I'm not even sure how that can compile.

var d:String = "<font color='#fff0000'><b>" + evt.user_message + "</b></font>";