Embed image into html and display it with RichText : Embed « Development « Flex
- Flex
- Development
- Embed
Embed image into html and display it with RichText

<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:s="library://ns.adobe.com/flex/spark">
<mx:Script>
import spark.utils.TextFlowUtil;
[Bindable]
public var txt:String = "<div>" +
"<img source='assets/icon.png' width='20' height='20' />" +
"<p>this is a test" + "<span fontWeight='bold'>bold</span>" +
"</p></div>";
</mx:Script>
<s:Graphic x="10" y="10">
<s:RichText width="400" height="60"
columnCount="4"
fontFamily="Helvetica"
textFlow="{TextFlowUtil.importFromString(txt)}"
/>
</s:Graphic>
</mx:Application>
Related examples in the same category