Skip to main content
liangyongning
Inspiring
May 23, 2012
Answered

How to copy Plain Text from TextFlow?

  • May 23, 2012
  • 1 reply
  • 7290 views

Hey guys,  I got stuck on Textflow copy-paste operation, I want to copy plain text from a textflow, don't want any text format/style but InlineGraphics, how can I do this?

This topic has been closed for replies.
Correct answer liangyongning

Maybe you can refer to the code of flashx.textLayout.conversion.TextConverter,  the default importers and exporters.

The default clipboard is

static tlf_internal function setFormatsToDefault():void

{    

      _descriptors = [];     

     addFormat(TEXT_LAYOUT_FORMAT, TextLayoutImporter, TextLayoutExporter, TEXT_LAYOUT_FORMAT);     

     addFormat(TEXT_FIELD_HTML_FORMAT, TextFieldHtmlImporter,  TextFieldHtmlExporter, null);     

     addFormat(PLAIN_TEXT_FORMAT, PlainTextImporter, PlainTextExporter, "air:text");

Besides, you may want to change the name of your class to avoid unexpected issues. You can see that there is already a TLF importer named PlainTextImporter.


After I remove the default TEXT_LAYOUT_FORMAT & TEXT_FIELD_HTML_FORMAT, everything goes right.

TextConverter.removeFormat(TextConverter.TEXT_LAYOUT_FORMAT);

TextConverter.removeFormat(TextConverter.TEXT_FIELD_HTML_FORMAT);

Thank you again!

1 reply

Adobe Employee
May 23, 2012

Please search Custom Clipboard inside TLF forum and blog.

http://blogs.adobe.com/tlf/

liangyongning
Inspiring
May 23, 2012

Thanks, will check it out