Skip to main content
Known Participant
February 14, 2011
Question

Questions about TextConverter.TEXT_FIELD_HTML_FORMAT

  • February 14, 2011
  • 1 reply
  • 2220 views

We currently have a lot of content produced which is displayed using the 'htmlText' property in the MX Text & TextArea components.  So basically we produce content that uses the 11 or so supported html tags.  I'm researching the TLF and SPARK components to see what we would have to change in order to use these new technologies.  I wanted to check my understanding of the TextConverter.TEXT_FIELD_HTML_FORMAT property.

Using that property seems straight forward.  I will have to upgrade my components to the SPARK Text components and use the TextFlow object that is created.  However, my questions are...

- In Flex 4.1 (and TLF 1.1) there seems to be some support lacking for the anchor tag and list tag.  The ASDOC for the anchor tag mentions that ActionScript link events are not supported.  Neither are a:link, a:hover, and a:active styles.  I believe I read somewhere that support has now been added or there are workarounds.  Is this true?  For the list tag, I know in TLF 2.0 ListElements are supported.  If I use TLF 2.0 and this TextConverter.TEXT_FIELD_HTML_FORMAT property, will my <li> tags just work?  The ASDOC I'm looking at is here: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flashx/textLayout/conversion/TextConverter.html#TEXT_FIELD_HTML_FORMAT

Thank you for your time!

This topic has been closed for replies.

1 reply

Adobe Employee
February 14, 2011

<li> tags are supported in TLF 2.0's HTMLTextFieldImporter.  An <li> that has no parent list will be wrapped in a bulleted list.

The importer doesn't support parsing a stylesheet.  The best option for connecting styles such as the link psuedo selectors is to attach a stylesheet using the mechanism described here.

http://blogs.adobe.com/tlf/2009/02/iformatresolver-and-using-css-1.html

Hope that helps,

Richard

dacaglSASAuthor
Known Participant
February 23, 2011

Thank you Richard!

A couple of follow up questions...

1.  If we were to use the HTMLTextFieldImporter class and continue to use the old TextField htmlText syntax, can we just add new "<div>" tags to the content we produce and they will just work?  By this I mean, since "<div>" was not supported with the TextField htmlText syntax but now is with TextFlow, can we just add "<div>" tags to the content we produce and the HTMLTextFieldImporter will still work and our "<div>" tags will be valid and rendered correctly?

2.  What advantage is there to switching to the TextFlow syntax if we already have procedures in place that produce the old TextField htmlText syntax and there is code in the TLF that imports it?  Is there any features or support we would miss out on if we don't use the TextFlow syntax?

Thank you once again!!

Adobe Employee
February 24, 2011

1 TLF 2.0 will support the div tags.  See this blog post:

http://blogs.adobe.com/tlf/2011/01/tlf-2-0-changes-subparagraphgroupelements-and-typename-applied-to-textfieldhtmlimporter-and-cssformatresolver.html

2 TextFieldHTML drops many features of TLF markup.  It doesn't roundtrip.  Of course if you limit what TLF features you use to those exported in TextFieldHTML and are satisified with the results then this is probably just fine for you.

Hope that helps,

Richard