Package | flashx.textLayout.conversion |
Interface | public interface ITextExporter |
Language Version: | ActionScript 3.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Property | Defined By | ||
---|---|---|---|
errors : Vector.<String> [read-only]
This property contains a vector of error messages as strings after a call
to an exporter method is the throwOnError property is set to
false, which is the default. | ITextExporter | ||
throwOnError : Boolean
The throwOnError property controls how the exporter handles errors. | ITextExporter | ||
useClipboardAnnotations : Boolean
The useClipboardAnnotations property controls whether or not the
importer should handle the extra information necessary for the clipboard. | ITextExporter |
Method | Defined By | ||
---|---|---|---|
Export text content from a TextFlow instance in String, or XML, or a user defined format. | ITextExporter |
errors | property |
errors:Vector.<String>
[read-only] Language Version: | ActionScript 3.0 |
Runtime Versions: | Flash Player 10.2, AIR 2.0 |
This property contains a vector of error messages as strings after a call
to an exporter method is the throwOnError
property is set to
false
, which is the default. If there were no errors, the
property returns null
. The property is reset on each method
call.
Implementation
public function get errors():Vector.<String>
throwOnError | property |
throwOnError:Boolean
Language Version: | ActionScript 3.0 |
Runtime Versions: | Flash Player 10.2, AIR 2.0 |
The throwOnError property controls how the exporter handles errors.
If set to true
, methods throw an Error instance on errors.
If set to false
, which is the default, errors are collected
into a vector of strings and stored in the errors
property,
and the exporter does not throw.
Implementation
public function get throwOnError():Boolean
public function set throwOnError(value:Boolean):void
useClipboardAnnotations | property |
useClipboardAnnotations:Boolean
Language Version: | ActionScript 3.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
The useClipboardAnnotations
property controls whether or not the
importer should handle the extra information necessary for the clipboard.
When data is in a TextFlow, paragraphs are always complete, and include a
terminator character. When a range of text is pasted to the clipboard, it
will form paragraphs, but the range may not include in the final terminator.
In this case, the paragraph needs to be marked as a partial paragraph if it
is intended for the clipboard, so that if it is later pasted it will merge
into the new text correctly. If the content is intended for the clipboard,
useClipboardAnnotations will be true.
Implementation
public function get useClipboardAnnotations():Boolean
public function set useClipboardAnnotations(value:Boolean):void
export | () | method |
public function export(source:flashx.textLayout.elements:TextFlow, conversionType:String):Object
Language Version: | ActionScript 3.0 |
Runtime Versions: | Flash Player 10, AIR 1.5 |
Export text content from a TextFlow instance in String, or XML, or a user defined format.
Set the conversionType
parameter to either of the following values,
or a user defined format in user-defined exporters.
flashx.textLayout.conversion.ConversionType.STRING_TYPE
;flashx.textLayout.conversion.ConversionType.XML_TYPE
.
Parameters
source:flashx.textLayout.elements:TextFlow — The TextFlow to export
| |
conversionType:String — Return a String (STRING_TYPE) or XML (XML_TYPE), or any user defined format.
|
Object — Object The exported content
|
Related API Elements
Example ( How to use this example )
This code snippet shows a use of the export
method
to perform repeated exports of formatted text.
package flashx.textLayout.conversion.examples { import flashx.textLayout.conversion.ConversionType; import flashx.textLayout.conversion.ITextExporter; import flashx.textLayout.conversion.TextConverter; import flashx.textLayout.elements.TextFlow; public class ITextExporterExample { // Serialize the TextFlow into a String static public function export(textFlow:TextFlow):String { var exporter:ITextExporter = TextConverter.getExporter(TextConverter.TEXT_LAYOUT_FORMAT); return exporter.export(textFlow, ConversionType.STRING_TYPE) as String; } } }
Wed Nov 21 2018, 06:34 AM -08:00