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?
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?
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!
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.