| Package | flashx.textLayout.conversion |
| Interface | public interface ITextImporter |
| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Public Properties
| Property | Defined By | ||
|---|---|---|---|
| errors : Vector.<String> [read-only]
Errors encountered while parsing. | ITextImporter | ||
| throwOnError : Boolean
Parsing errors during import will cause exceptions if throwOnError is true. | ITextImporter | ||
Public Methods
| Method | Defined By | ||
|---|---|---|---|
Import text content from an external source and convert it into a TextFlow. | ITextImporter | ||
Property Detail
errors | property |
errors:Vector.<String> [read-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Errors encountered while parsing. This will be empty if there were no errors. Value is a vector of Strings.
Implementation
public function get errors():Vector.<String>throwOnError | property |
throwOnError:Boolean| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Parsing errors during import will cause exceptions if throwOnError is true.
Implementation
public function get throwOnError():Boolean public function set throwOnError(value:Boolean):voidMethod Detail
importToFlow | () | method |
public function importToFlow(source:Object):flashx.textLayout.elements:TextFlow| Language Version: | ActionScript 3.0 |
| Runtime Versions: | Flash Player 10, AIR 1.5 |
Import text content from an external source and convert it into a TextFlow.
Parameters
source:Object — Data to convert
|
flashx.textLayout.elements:TextFlow — TextFlow created from the source.
|
Examples How to use this example
ITextImporterExample.as
This code snippet shows a use of the ITextImporter method
to perform repeated imports of formatted text. Note that errors are cleared at the
beginning of each call to importToFlow.
package flashx.textLayout.conversion.examples
{
import flashx.textLayout.conversion.ITextImporter;
import flashx.textLayout.conversion.TextConverter;
import flashx.textLayout.elements.TextFlow;
public class ITextImporterExample
{
// Create a new TextFlow based on the markup string
static public function importAndCheckErrors():TextFlow
{
var markup:String = "<TextFlow xmlns='http://ns.adobe.com/textLayout/2008'><p><span>Hello, World</span></p></TextFlow>";
var importer:ITextImporter = TextConverter.getImporter(TextConverter.TEXT_LAYOUT_FORMAT);
importer.throwOnError = false;
var textFlow:TextFlow = importer.importToFlow(markup);
if (!textFlow)
{
var errors:Vector.<String> = importer.errors;
//deal with import errors
}
return textFlow;
}
}
}
Thu May 20 2010, 02:19 AM -07:00
