Adobe® Flex® 4 Language Reference
Show Packages and Classes List |  Packages  |  Classes  |  Index  |  Appendixes
flashx.textLayout.conversion 
ITextExporter 
Packageflashx.textLayout.conversion
Interfacepublic interface ITextExporter
Implementors PlainTextExporter

Language Version: ActionScript 3.0
Runtime Versions: Flash Player 10, AIR 1.5

Interface for exporting text content from a TextFlow instance to either String or XML format.



Public Methods
 MethodDefined By
  
Export text content from a TextFlow instance in String or XML format.
ITextExporter
Method Detail

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 format.

Set the conversionType parameter to either of the following values:

  • 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).

Returns
Object — Object The exported content

See also


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;
        }
    }
}