2011-01-05 4 views
1

Flex/Air 애플리케이션의 개발자로 일하고 있으며 사용자가 노트를 관리 할 수 ​​있도록 버그있는 Flex RTE (RichTextEditor)를 사용하고 있습니다. 현재 TLF (텍스트 레이아웃 프레임 워크)를 사용하여 새 텍스트 구성 요소를 작성하는 것이 얼마나 비용이 많이 드는지 평가하려고합니다.Flex RTTE HtmlText from TLF TextFlow 가져 오기

RTE에서 직접 제작 한 HTML 텍스트를 가져올 수 있다면 정말 중요한 질문입니다. TLF 1.1을 사용하는 목록에 대해서는 몇 가지 제한 사항이 있지만 일반적으로 작동합니까?

난 그냥 같은 RTE에서 일부 HTML 형식의 텍스트를 잡기 위해 노력했다 :이 같은 TextConverter이를 통과 할 때

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>' 

:

var textFlow:TextFlow = TextConverter.importToFlow(htmlText, TextConverter.HTML_FORMAT); 

플래시 플레이어는 예외가 발생합니다. 나는 또한 텍스트를

<html><body></body></html> 

으로 감싸려고했지만 동일한 문제가 있습니다. 그래서 그것은 곧바로 작동하지 않는 것 같습니다. 너는 무엇을 경험하고 있니? 이것은 우리에게 정말로 중요합니다.

UPDATE 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); 

한편 내가 태그를 제거하고 작동하지만, 질문 여전히 유적.

미리 감사드립니다.

+0

예외는 무엇입니까? – JeffryHouser

+0

안녕하세요, 업데이트 1 참조 .. 감사합니다. – dasnervtdoch

답변

0

당신이 무엇을 사용 될 것으로 보인다 어느 것도 형식에 대한 세 가지 상수가있다 http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flashx/textLayout/conversion/TextConverter.html

를 살펴 보자 :

또한
PLAIN_TEXT_FORMAT 
TEXT_FIELD_HTML_FORMAT 
TEXT_LAYOUT_FORMAT 

다음 "HTML"코드 외모의 형식 HTML보다 TLF 형식의 XML에 가깝습니다.

<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> 
관련 문제