"But i still wonder if it is possible to be handled directly in mxml ? Especially if the binded variable changes i need it to be updated in the text component."
Hichem
You can bind the property to a function call so that whenever the bound value changes the result of the function call is used as the value to htmlText
:
<mx:Script>
<![CDATA[
function sayHello(userName:String):String
{
var text:String = "<![CDATA[<img src='assets.OrangeRect' align='left' hspace='0' vspace='4'/> Bonjour " + userName + " ]]>";
return text;
}
]]>
</mx:Script>
<mx:Text id="bodyText" styleName="bodyText" htmlText="{sayHello(UserData.name)}" />
This is like a combination of the two - specify your binding in MXML, but have the value generated in the scripting section.