Flex Mxml and property as string, escaping? Help

Simple task: if I use escape characters for a property like

<mx:Image  id="img" toolTip="\\foo{\\bar}"

      

It does not validate the hint and therefore does not compile.

What solution?

0


source to share


2 answers


You can use ActionScipt, for example, in the createComplete event handler and assign the tooltip to you, and you won't have the same limitations as in MXML.

But you can also avoid these limitations in MXML with CDATA:



<mx:Image id="img" source="foo.jpg" width="50" height="50">
<mx:toolTip>
    <![CDATA[\foo{\bar} or any usually forbidden characters as <, >, &, "'"...]]>
</mx:toolTip></mx:Image>

      

+2


source


You can use HTML format for special characters. <mx:Image id="img" toolTip="&#092;foo&#123;&#092;bar&#125;"/>



+1


source







All Articles