【发布时间】:2011-07-25 09:24:39
【问题描述】:
请参阅下面创建的简单应用程序。我有一个 RichTextEditor 和一个 RichText 组件。这个想法是在 RichText 组件中显示在 RichTextEditor 中键入的任何内容。除了子弹之外,其他一切(我认为)都有效!转换就像子弹不存在一样工作!
<?xml version="1.0" encoding="utf-8"?>
<s:Application width="100%"
height="100%"
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">
<s:layout>
<s:HorizontalLayout />
</s:layout>
<fx:Script>
<![CDATA[
import flashx.textLayout.conversion.TextConverter;
import mx.events.FlexEvent;
protected function convert_clickHandler(event:MouseEvent):void
{
richText.textFlow = TextConverter.importToFlow(editor.htmlText, TextConverter.TEXT_FIELD_HTML_FORMAT);
}
]]>
</fx:Script>
<mx:RichTextEditor id="editor" />
<s:Button id="convert" click="convert_clickHandler(event)" />
<s:RichText id="richText" />
</s:Application>
关于如何使 Bullets 与 RichText 一起使用的任何想法?我使用正确的转换方法吗? TextConverter.importToFlow?
见下图。
【问题讨论】:
标签: apache-flex flex4 rich-text-editor richtext