Skip to main content
liangyongning
Inspiring
May 23, 2012 3:24 AM UTC
Answered

How to copy Plain Text from TextFlow?

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 is closed to new replies. Start a new post to keep the conversation going.
liangyongning
liangyongningCorrect answer
Inspiring
May 24, 2012 2:02 PM UTC

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!

11 replies

Adobe Employee
May 23, 2012 3:27 AM UTC

Please search Custom Clipboard inside TLF forum and blog.

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

Translate
liangyongning
Inspiring
May 23, 2012 3:30 AM UTC

Thanks, will check it out

Translate