Skip to main content
Participating Frequently
August 12, 2010
Question

two ways to get dynamic text into my <s:RichEditableText

  • August 12, 2010
  • 1 reply
  • 457 views

font styling doesnt work with..
textFlow="{TextConverter.importToFlow( articleText, TextConverter.TEXT_FIELD_HTML_FORMAT )}"

images dont work with..
textFlow="{TextFlowUtil.importFromString(articleTe  xt)}


the problem is one way shows the images i have in img tags the other shows text styles shown with

<p fontSize="20" fontFamily="GillSansStd"     color="#ffffff">Welcome...</p>
<br /><br />

…and congratulations<img src='../creative/assets/trinidad.jpg' width="100" height="200" align="top"/>

Really appreciate any helpful postings with understanding why there are two ways and which is better or another way entirely.

thanks

This topic has been closed for replies.

1 reply

Adobe Employee
August 16, 2010

It's hard to tell what's going wrong without more information. There are two different ways to do it so that you have flexibility in how you set it up. If you are starting from markup, then I think importToFlow is probably the easier way to go. But if you already have a TextFlow, for example because you have programmatically constructed it, then you can use the second

For the importToFlow method, the first thing to check is whether you got a null TextFlow back from importToFlow. This can happen if errors are encountered during the import (for example, invalid XML). If you are getting a null TextFlow, you can figure out why changing slightly how you call importToFlow. Instead of invoking it directly on the TextConverter, do this:

var importer:ITextImporter = TextConverter.getImporter(TextConvert.TEXT_LAYOUT_FORMAT);

importer.throwOnError = true;

var textFlow:TextFlow = importer.importToFlow(articleText);

This will result in an exception being thrown when the error is encountered.

Hope this helps,

- robin