私は Flex/Air アプリケーションの開発者として働いており、バグのある Flex RTE (RichTextEditor) を使用して、ユーザーがメモを管理できるようにしています。現時点では、TLF (Text Layout Framework) を使用して新しいテキスト コンポーネントを構築するのにどれくらいのコストがかかるかを評価しようとしています。
本当に重要なのは、RTE によって生成された HTML テキストをすぐにインポートできるかどうかです。TLF 1.1 のリストに関していくつかの制限があることは知っていますが、一般的に機能しますか?
次のような RTE から HTML 形式のテキストを取得しようとしました。
var htmlText:String = '<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="defaultFont" SIZE="14" COLOR="#000000" LETTERSPACING="0" KERNING="0">1hr run on Wednesday - feeling ok!</FONT></P></TEXTFORMAT>'
これを TextConverter に次のように渡すと:
var textFlow:TextFlow = TextConverter.importToFlow(htmlText, TextConverter.HTML_FORMAT);
Flash Player が例外をスローします。また、テキストをラップしようとしました
<html><body></body></html>
、しかし同じ問題。そのため、すぐには機能しないようです。あなたは何を経験していますか?これは私たちにとって非常に重要です。
更新 1:
上記のように HTML をインポートしようとすると (同じ変数宣言)、次のエラーが発生します。
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at flashx.textLayout.formats::TextLayoutFormatValueHolder/apply()[C:\Vellum\branches\v1\1.0\dev\textLayout_core\src\flashx\textLayout\formats\TextLayoutFormatValueHolder.as:357]
at HtmlImporter$/parseTextFormat()[C:\Vellum\branches\v1\1.0\dev\textLayout_conversion\src\flashx\textLayout\conversion\HtmlImporter.as:307]
at BaseTextLayoutImporter/parseObject()[C:\Vellum\branches\v1\1.0\dev\textLayout_conversion\src\flashx\textLayout\conversion\BaseTextLayoutImporter.as:464]
at BaseTextLayoutImporter/parseFlowGroupElementChildren()[C:\Vellum\branches\v1\1.0\dev\textLayout_conversion\src\flashx\textLayout\conversion\BaseTextLayoutImporter.as:419]
at HtmlImporter$/parseHtmlContainer()[C:\Vellum\branches\v1\1.0\dev\textLayout_conversion\src\flashx\textLayout\conversion\HtmlImporter.as:269]
at BaseTextLayoutImporter/parseObject()[C:\Vellum\branches\v1\1.0\dev\textLayout_conversion\src\flashx\textLayout\conversion\BaseTextLayoutImporter.as:464]
at HtmlImporter/importFromXML()[C:\Vellum\branches\v1\1.0\dev\textLayout_conversion\src\flashx\textLayout\conversion\HtmlImporter.as:142]
at HtmlImporter/importFromString()[C:\Vellum\branches\v1\1.0\dev\textLayout_conversion\src\flashx\textLayout\conversion\HtmlImporter.as:130]
at BaseTextLayoutImporter/importToFlow()[C:\Vellum\branches\v1\1.0\dev\textLayout_conversion\src\flashx\textLayout\conversion\BaseTextLayoutImporter.as:73]
at flashx.textLayout.conversion::TextConverter$/importToFlow()[C:\Vellum\branches\v1\1.0\dev\textLayout_conversion\src\flashx\textLayout\conversion\TextConverter.as:87]
at TLFTestApp/init()[/Users/Arne/Documents/Adobe Flash Builder 4/TLFRichTextEditor/src/TLFTestApp.mxml:29] <-- // executing TextConverter.importToFlow(htmlText, TextConverter.HTML_FORMAT);
その間、タグを削除して動作しましたが、問題はまだ残っています。
前もって感謝します!