用于 Adobe® Flash® Platform 的 ActionScript® 3.0 参考
主页  |  隐藏包列表和类列表 |   |   |  新增内容  |  索引  |  附录  |  为什么显示为英语?
过滤条件: AIR 30.0 和更早版本, Flash Player 30.0 和更早版本, Flash Lite 4
Flex 4.6 和更早版本, Flash Pro CS6 和更早版本
隐藏过滤条件
flashx.textLayout.conversion 

TextConverter  - AS3

x

顶级
adobe.utils
air.desktop
air.net
air.update
air.update.events
coldfusion.air
coldfusion.air.errors
coldfusion.air.events
coldfusion.service
coldfusion.service.events
coldfusion.service.mxml
com.adobe.acm.solutions.authoring.domain.extensions
com.adobe.acm.solutions.ccr.domain.extensions
com.adobe.consulting.pst.vo
com.adobe.dct.component
com.adobe.dct.component.datadictionary
com.adobe.dct.component.datadictionaryElement
com.adobe.dct.component.dataElementsPanel
com.adobe.dct.component.toolbars
com.adobe.dct.event
com.adobe.dct.exp
com.adobe.dct.model
com.adobe.dct.service
com.adobe.dct.service.provider
com.adobe.dct.transfer
com.adobe.dct.util
com.adobe.dct.view
com.adobe.ep.taskmanagement.domain
com.adobe.ep.taskmanagement.event
com.adobe.ep.taskmanagement.filter
com.adobe.ep.taskmanagement.services
com.adobe.ep.taskmanagement.util
com.adobe.ep.ux.attachmentlist.component
com.adobe.ep.ux.attachmentlist.domain
com.adobe.ep.ux.attachmentlist.domain.events
com.adobe.ep.ux.attachmentlist.domain.renderers
com.adobe.ep.ux.attachmentlist.skin
com.adobe.ep.ux.attachmentlist.skin.renderers
com.adobe.ep.ux.content.event
com.adobe.ep.ux.content.factory
com.adobe.ep.ux.content.handlers
com.adobe.ep.ux.content.managers
com.adobe.ep.ux.content.model.asset
com.adobe.ep.ux.content.model.preview
com.adobe.ep.ux.content.model.relation
com.adobe.ep.ux.content.model.search
com.adobe.ep.ux.content.model.toolbar
com.adobe.ep.ux.content.search
com.adobe.ep.ux.content.services
com.adobe.ep.ux.content.services.load
com.adobe.ep.ux.content.services.permissions
com.adobe.ep.ux.content.services.preview
com.adobe.ep.ux.content.services.providers
com.adobe.ep.ux.content.services.query
com.adobe.ep.ux.content.services.relationships
com.adobe.ep.ux.content.services.search.lccontent
com.adobe.ep.ux.content.services.version
com.adobe.ep.ux.content.view
com.adobe.ep.ux.content.view.components.activate
com.adobe.ep.ux.content.view.components.grid
com.adobe.ep.ux.content.view.components.grid.hover
com.adobe.ep.ux.content.view.components.grid.hover.component
com.adobe.ep.ux.content.view.components.grid.renderers
com.adobe.ep.ux.content.view.components.relationships
com.adobe.ep.ux.content.view.components.review
com.adobe.ep.ux.content.view.components.search.renderers
com.adobe.ep.ux.content.view.components.searchpod
com.adobe.ep.ux.content.view.components.toolbar
com.adobe.ep.ux.content.view.components.toolbar.controlRenderers
com.adobe.ep.ux.content.view.components.version
com.adobe.ep.ux.documentsubmit.component
com.adobe.ep.ux.documentsubmit.domain
com.adobe.ep.ux.documentsubmit.skin
com.adobe.ep.ux.taskaction.component
com.adobe.ep.ux.taskaction.domain
com.adobe.ep.ux.taskaction.domain.events
com.adobe.ep.ux.taskaction.skin
com.adobe.ep.ux.taskdetails.component
com.adobe.ep.ux.taskdetails.domain
com.adobe.ep.ux.taskdetails.skin
com.adobe.ep.ux.tasklist.component
com.adobe.ep.ux.tasklist.domain
com.adobe.ep.ux.tasklist.skin
com.adobe.ep.ux.webdocumentviewer.domain
com.adobe.exm.expression
com.adobe.exm.expression.error
com.adobe.exm.expression.event
com.adobe.exm.expression.impl
com.adobe.fiber.runtime.lib
com.adobe.fiber.services
com.adobe.fiber.services.wrapper
com.adobe.fiber.styles
com.adobe.fiber.util
com.adobe.fiber.valueobjects
com.adobe.gravity.binding
com.adobe.gravity.context
com.adobe.gravity.flex.bundleloader
com.adobe.gravity.flex.progress
com.adobe.gravity.flex.serviceloader
com.adobe.gravity.framework
com.adobe.gravity.init
com.adobe.gravity.service.bundleloader
com.adobe.gravity.service.logging
com.adobe.gravity.service.manifest
com.adobe.gravity.service.progress
com.adobe.gravity.tracker
com.adobe.gravity.ui
com.adobe.gravity.utility
com.adobe.gravity.utility.async
com.adobe.gravity.utility.error
com.adobe.gravity.utility.events
com.adobe.gravity.utility.factory
com.adobe.gravity.utility.flex.async
com.adobe.gravity.utility.logging
com.adobe.gravity.utility.message
com.adobe.gravity.utility.sequence
com.adobe.gravity.utility.url
com.adobe.guides.control
com.adobe.guides.domain
com.adobe.guides.i18n
com.adobe.guides.spark.components.skins
com.adobe.guides.spark.components.skins.mx
com.adobe.guides.spark.headers.components
com.adobe.guides.spark.headers.skins
com.adobe.guides.spark.layouts.components
com.adobe.guides.spark.layouts.skins
com.adobe.guides.spark.navigators.components
com.adobe.guides.spark.navigators.renderers
com.adobe.guides.spark.navigators.skins
com.adobe.guides.spark.util
com.adobe.guides.spark.wrappers.components
com.adobe.guides.spark.wrappers.skins
com.adobe.guides.submit
com.adobe.icc.dc.domain
com.adobe.icc.dc.domain.factory
com.adobe.icc.editors.events
com.adobe.icc.editors.handlers
com.adobe.icc.editors.managers
com.adobe.icc.editors.model
com.adobe.icc.editors.model.config
com.adobe.icc.editors.model.el
com.adobe.icc.editors.model.el.operands
com.adobe.icc.editors.model.el.operators
com.adobe.icc.enum
com.adobe.icc.external.dc
com.adobe.icc.obj
com.adobe.icc.services
com.adobe.icc.services.category
com.adobe.icc.services.config
com.adobe.icc.services.download
com.adobe.icc.services.export
com.adobe.icc.services.external
com.adobe.icc.services.formbridge
com.adobe.icc.services.fragmentlayout
com.adobe.icc.services.layout
com.adobe.icc.services.letter
com.adobe.icc.services.locator
com.adobe.icc.services.module
com.adobe.icc.services.render
com.adobe.icc.services.submit
com.adobe.icc.services.user
com.adobe.icc.token
com.adobe.icc.vo
com.adobe.icc.vo.render
com.adobe.icomm.assetplacement.controller
com.adobe.icomm.assetplacement.controller.utils
com.adobe.icomm.assetplacement.data
com.adobe.icomm.assetplacement.model
com.adobe.livecycle.assetmanager.client
com.adobe.livecycle.assetmanager.client.event
com.adobe.livecycle.assetmanager.client.handler
com.adobe.livecycle.assetmanager.client.managers
com.adobe.livecycle.assetmanager.client.model
com.adobe.livecycle.assetmanager.client.model.cms
com.adobe.livecycle.assetmanager.client.service
com.adobe.livecycle.assetmanager.client.service.search
com.adobe.livecycle.assetmanager.client.service.search.cms
com.adobe.livecycle.assetmanager.client.utils
com.adobe.livecycle.content
com.adobe.livecycle.rca.model
com.adobe.livecycle.rca.model.constant
com.adobe.livecycle.rca.model.document
com.adobe.livecycle.rca.model.participant
com.adobe.livecycle.rca.model.reminder
com.adobe.livecycle.rca.model.stage
com.adobe.livecycle.rca.service
com.adobe.livecycle.rca.service.core
com.adobe.livecycle.rca.service.core.delegate
com.adobe.livecycle.rca.service.process
com.adobe.livecycle.rca.service.process.delegate
com.adobe.livecycle.rca.token
com.adobe.livecycle.ria.security.api
com.adobe.livecycle.ria.security.service
com.adobe.mosaic.layouts
com.adobe.mosaic.layouts.dragAndDrop
com.adobe.mosaic.layouts.interfaces
com.adobe.mosaic.mxml
com.adobe.mosaic.om.constants
com.adobe.mosaic.om.events
com.adobe.mosaic.om.impl
com.adobe.mosaic.om.interfaces
com.adobe.mosaic.skinning
com.adobe.mosaic.sparklib.editors
com.adobe.mosaic.sparklib.optionMenu
com.adobe.mosaic.sparklib.scrollableMenu
com.adobe.mosaic.sparklib.scrollableMenu.skins
com.adobe.mosaic.sparklib.tabLayout
com.adobe.mosaic.sparklib.tabLayout.events
com.adobe.mosaic.sparklib.tabLayout.layouts
com.adobe.mosaic.sparklib.tabLayout.skins
com.adobe.mosaic.sparklib.text
com.adobe.mosaic.sparklib.util
com.adobe.solutions.acm.authoring.presentation
com.adobe.solutions.acm.authoring.presentation.actionbar
com.adobe.solutions.acm.authoring.presentation.common
com.adobe.solutions.acm.authoring.presentation.events
com.adobe.solutions.acm.authoring.presentation.fragment
com.adobe.solutions.acm.authoring.presentation.letter
com.adobe.solutions.acm.authoring.presentation.letter.data
com.adobe.solutions.acm.authoring.presentation.preview
com.adobe.solutions.acm.authoring.presentation.rte
com.adobe.solutions.acm.ccr.presentation
com.adobe.solutions.acm.ccr.presentation.contentcapture
com.adobe.solutions.acm.ccr.presentation.contentcapture.events
com.adobe.solutions.acm.ccr.presentation.contentcapture.preview
com.adobe.solutions.acm.ccr.presentation.datacapture
com.adobe.solutions.acm.ccr.presentation.datacapture.renderers
com.adobe.solutions.acm.ccr.presentation.pdf
com.adobe.solutions.exm
com.adobe.solutions.exm.authoring
com.adobe.solutions.exm.authoring.components.controls
com.adobe.solutions.exm.authoring.components.toolbars
com.adobe.solutions.exm.authoring.domain
com.adobe.solutions.exm.authoring.domain.expression
com.adobe.solutions.exm.authoring.domain.impl
com.adobe.solutions.exm.authoring.domain.method
com.adobe.solutions.exm.authoring.domain.variable
com.adobe.solutions.exm.authoring.enum
com.adobe.solutions.exm.authoring.events
com.adobe.solutions.exm.authoring.model
com.adobe.solutions.exm.authoring.renderer
com.adobe.solutions.exm.authoring.view
com.adobe.solutions.exm.expression
com.adobe.solutions.exm.impl
com.adobe.solutions.exm.impl.method
com.adobe.solutions.exm.method
com.adobe.solutions.exm.mock
com.adobe.solutions.exm.mock.method
com.adobe.solutions.exm.runtime
com.adobe.solutions.exm.runtime.impl
com.adobe.solutions.exm.variable
com.adobe.solutions.prm.constant
com.adobe.solutions.prm.domain
com.adobe.solutions.prm.domain.factory
com.adobe.solutions.prm.domain.impl
com.adobe.solutions.prm.domain.manager
com.adobe.solutions.prm.presentation.asset
com.adobe.solutions.prm.presentation.constant
com.adobe.solutions.prm.presentation.document
com.adobe.solutions.prm.presentation.event
com.adobe.solutions.prm.presentation.file
com.adobe.solutions.prm.presentation.project
com.adobe.solutions.prm.presentation.team
com.adobe.solutions.prm.presentation.util
com.adobe.solutions.prm.service
com.adobe.solutions.prm.services.impl
com.adobe.solutions.prm.vo
com.adobe.solutions.rca.constant
com.adobe.solutions.rca.domain
com.adobe.solutions.rca.domain.common
com.adobe.solutions.rca.domain.factory
com.adobe.solutions.rca.domain.impl
com.adobe.solutions.rca.domain.impl.manager
com.adobe.solutions.rca.domain.manager
com.adobe.solutions.rca.presentation
com.adobe.solutions.rca.presentation.comment
com.adobe.solutions.rca.presentation.constant
com.adobe.solutions.rca.presentation.event
com.adobe.solutions.rca.presentation.gantt
com.adobe.solutions.rca.presentation.gantt.ruler
com.adobe.solutions.rca.presentation.template
com.adobe.solutions.rca.presentation.template.audit
com.adobe.solutions.rca.presentation.template.definition
com.adobe.solutions.rca.presentation.template.documents
com.adobe.solutions.rca.presentation.template.stages
com.adobe.solutions.rca.presentation.util
com.adobe.solutions.rca.service
com.adobe.solutions.rca.services.impl
com.adobe.solutions.rca.vo
com.adobe.solutions.rca.vo.um
com.adobe.viewsource
fl.accessibility
fl.containers
fl.controls
fl.controls.dataGridClasses
fl.controls.listClasses
fl.controls.progressBarClasses
fl.core
fl.data
fl.display
fl.events
fl.ik
fl.lang
fl.livepreview
fl.managers
fl.motion
fl.motion.easing
fl.rsl
fl.text
fl.transitions
fl.transitions.easing
fl.video
flash.accessibility
flash.concurrent
flash.crypto
flash.data
flash.desktop
flash.display
flash.display3D
flash.display3D.textures
flash.errors
flash.events
flash.external
flash.filesystem
flash.filters
flash.geom
flash.globalization
flash.html
flash.media
flash.net
flash.net.dns
flash.net.drm
flash.notifications
flash.permissions
flash.printing
flash.profiler
flash.sampler
flash.security
flash.sensors
flash.system
flash.text
flash.text.engine
flash.text.ime
flash.ui
flash.utils
flash.xml
flashx.textLayout
flashx.textLayout.compose
flashx.textLayout.container
flashx.textLayout.conversion
flashx.textLayout.edit
flashx.textLayout.elements
flashx.textLayout.events
flashx.textLayout.factory
flashx.textLayout.formats
flashx.textLayout.operations
flashx.textLayout.utils
flashx.undo
ga.controls
ga.layouts
ga.model
ga.uiComponents
ga.util
ga.views
ga.wrappers
lc.foundation
lc.foundation.domain
lc.foundation.events
lc.foundation.ui
lc.foundation.util
lc.preloader
lc.procmgmt
lc.procmgmt.commands
lc.procmgmt.domain
lc.procmgmt.events
lc.procmgmt.formbridge
lc.procmgmt.impl
lc.procmgmt.ui.attachments
lc.procmgmt.ui.controls
lc.procmgmt.ui.controls.card
lc.procmgmt.ui.controls.renderer
lc.procmgmt.ui.help
lc.procmgmt.ui.layout
lc.procmgmt.ui.presentationmodel
lc.procmgmt.ui.process
lc.procmgmt.ui.search
lc.procmgmt.ui.startpoint
lc.procmgmt.ui.task
lc.procmgmt.ui.task.form
lc.procmgmt.ui.task.form.commands
lc.procmgmt.ui.tracking
mx.accessibility
mx.automation
mx.automation.air
mx.automation.delegates
mx.automation.delegates.advancedDataGrid
mx.automation.delegates.charts
mx.automation.delegates.containers
mx.automation.delegates.controls
mx.automation.delegates.controls.dataGridClasses
mx.automation.delegates.controls.fileSystemClasses
mx.automation.delegates.core
mx.automation.delegates.flashflexkit
mx.automation.events
mx.binding
mx.binding.utils
mx.charts
mx.charts.chartClasses
mx.charts.effects
mx.charts.effects.effectClasses
mx.charts.events
mx.charts.renderers
mx.charts.series
mx.charts.series.items
mx.charts.series.renderData
mx.charts.styles
mx.collections
mx.collections.errors
mx.containers
mx.containers.accordionClasses
mx.containers.dividedBoxClasses
mx.containers.errors
mx.containers.utilityClasses
mx.controls
mx.controls.advancedDataGridClasses
mx.controls.dataGridClasses
mx.controls.listClasses
mx.controls.menuClasses
mx.controls.olapDataGridClasses
mx.controls.scrollClasses
mx.controls.sliderClasses
mx.controls.textClasses
mx.controls.treeClasses
mx.controls.videoClasses
mx.core
mx.core.windowClasses
mx.data
mx.data.crypto
mx.data.errors
mx.data.events
mx.data.messages
mx.data.mxml
mx.data.offline.errors
mx.data.utils
mx.effects
mx.effects.easing
mx.effects.effectClasses
mx.events
mx.filters
mx.flash
mx.formatters
mx.geom
mx.graphics
mx.graphics.codec
mx.graphics.shaderClasses
mx.logging
mx.logging.errors
mx.logging.targets
mx.managers
mx.messaging
mx.messaging.channels
mx.messaging.config
mx.messaging.errors
mx.messaging.events
mx.messaging.management
mx.messaging.messages
mx.modules
mx.netmon
mx.olap
mx.olap.aggregators
mx.preloaders
mx.printing
mx.resources
mx.rpc
mx.rpc.events
mx.rpc.http
mx.rpc.http.mxml
mx.rpc.livecycle
mx.rpc.mxml
mx.rpc.remoting
mx.rpc.remoting.mxml
mx.rpc.soap
mx.rpc.soap.mxml
mx.rpc.wsdl
mx.rpc.xml
mx.skins
mx.skins.halo
mx.skins.spark
mx.skins.wireframe
mx.skins.wireframe.windowChrome
mx.states
mx.styles
mx.utils
mx.validators
org.osmf.containers
org.osmf.display
org.osmf.elements
org.osmf.events
org.osmf.layout
org.osmf.logging
org.osmf.media
org.osmf.metadata
org.osmf.net
org.osmf.net.dvr
org.osmf.net.httpstreaming
org.osmf.net.metrics
org.osmf.net.qos
org.osmf.net.rtmpstreaming
org.osmf.net.rules
org.osmf.traits
org.osmf.utils
spark.accessibility
spark.automation.delegates
spark.automation.delegates.components
spark.automation.delegates.components.gridClasses
spark.automation.delegates.components.mediaClasses
spark.automation.delegates.components.supportClasses
spark.automation.delegates.skins.spark
spark.automation.events
spark.collections
spark.components
spark.components.calendarClasses
spark.components.gridClasses
spark.components.mediaClasses
spark.components.supportClasses
spark.components.windowClasses
spark.core
spark.effects
spark.effects.animation
spark.effects.easing
spark.effects.interpolation
spark.effects.supportClasses
spark.events
spark.filters
spark.formatters
spark.formatters.supportClasses
spark.globalization
spark.globalization.supportClasses
spark.layouts
spark.layouts.supportClasses
spark.managers
spark.modules
spark.preloaders
spark.primitives
spark.primitives.supportClasses
spark.skins
spark.skins.mobile
spark.skins.mobile.supportClasses
spark.skins.spark
spark.skins.spark.mediaClasses.fullScreen
spark.skins.spark.mediaClasses.normal
spark.skins.spark.windowChrome
spark.skins.wireframe
spark.skins.wireframe.mediaClasses
spark.skins.wireframe.mediaClasses.fullScreen
spark.transitions
spark.utils
spark.validators
spark.validators.supportClasses
xd.core.axm.enterprise.view.components
xd.core.axm.enterprise.view.skins
xd.core.axm.view.components
xd.core.axm.view.components.support

语言元素

全局常量
全局函数
运算符
语句、关键字和指令
特殊类型

附录

新增内容
编译器错误
编译器警告
运行时错误
迁移到 ActionScript 3
支持的字符集
仅适用于 MXML 的标签
Motion XML 元素
Timed Text 标记
不推荐使用的元素的列表
AccessibilityImplementation 常量
如何使用 ActionScript 示例
法律声明
flashx.textLayout.conversion
public class TextConverter
继承TextConverter Inheritance Object

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

这是用于处理导入和导出的网关类。该类用作对 Text Layout Framework 中转换功能的统一访问点。该类包含用于预定义以及用户定义的输入和/或输出转换器的注册表,还有一组转换方法。

未预定义已转换数据的格式,用户写入的转换器可以接受和返回其选择的任何格式。常用格式为字符串、XML 和 ByteArray 实例。转换器作者应该记录哪些格式受支持。

查看示例



公共属性
 属性由以下参数定义
 Inheritedconstructor : Object
对类对象或给定对象实例的构造函数的引用。
Object
  numFormats : int
[静态] [只读] 格式数量。
TextConverter
公共方法
 方法由以下参数定义
  
addFormat(format:String, importerClass:Class, exporterClass:Class, clipboardFormat:String):void
[静态] 为导入/导出注册新格式。
TextConverter
  
addFormatAt(index:int, format:String, importerClass:Class, exporterClass:Class = null, clipboardFormat:String = null):void
[静态] 在指定位置为导入/导出注册新格式。
TextConverter
  
[静态] 将 TextFlow 导出为指定格式。
TextConverter
  
[静态] 创建并返回导出转换器,可使用该转换器从 TextFlow 导出到源字符串或 XML 对象。
TextConverter
  
[静态] 返回第 index 个格式的格式名称。
TextConverter
  
[静态] 返回第 index 个格式的 FormatDescriptor。
TextConverter
  
[静态] 创建并返回导入转换器,您之后可以使用该转换器从源字符串、XML 对象或任何用户定义的数据格式导入到 TextFlow。
TextConverter
 Inherited
表示对象是否已经定义了指定的属性。
Object
  
[静态] 基于指定格式的源内容创建 TextFlow。
TextConverter
 Inherited
表示 Object 类的实例是否在指定为参数的对象的原型链中。
Object
 Inherited
表示指定的属性是否存在、是否可枚举。
Object
  
[静态] 删除格式。
TextConverter
  
[静态] 删除在索引位置的格式。
TextConverter
 Inherited
设置循环操作动态属性的可用性。
Object
 Inherited
返回此对象的字符串表示形式,其格式设置遵守区域设置特定的约定。
Object
 Inherited
返回指定对象的字符串表示形式。
Object
 Inherited
返回指定对象的原始值。
Object
公共常量
 常量由以下参数定义
  PLAIN_TEXT_FORMAT : String = "plainTextFormat"
[静态] 纯文本格式。
TextConverter
  TEXT_FIELD_HTML_FORMAT : String = "textFieldHTMLFormat"
[静态] HTML 格式。
TextConverter
  TEXT_LAYOUT_FORMAT : String = "textLayoutFormat"
[静态] TextLayout 格式。
TextConverter
属性详细信息

numFormats

属性
numFormats:int  [只读]

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

格式数量。



实现
    public static function get numFormats():int
方法详细信息

addFormat

()方法
public static function addFormat(format:String, importerClass:Class, exporterClass:Class, clipboardFormat:String):void

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

为导入/导出注册新格式。新格式将添加在末尾,作为最低优先级。对于使用的格式具有多个选择(例如从外部剪贴板导入时)的客户端来说,位置十分重要。新的格式可能支持导入和/或导出。如果已添加此格式,则会在多个位置中存在。会使用首先找到的格式。

参数

format:String — 要注册的导入转换器类或为 null
 
importerClass:Class — 要注册的导出转换器类或为 null
 
exporterClass:Class — 标记转换器类的格式字符串。格式可以为任何名称,但必须是唯一的。
 
clipboardFormat:String — 转换到剪贴板/从剪贴板转换时用作剪贴板格式的字符串。如果格式不支持剪贴板访问,则使其为 null。

addFormatAt

()方法 
public static function addFormatAt(index:int, format:String, importerClass:Class, exporterClass:Class = null, clipboardFormat:String = null):void

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

在指定位置为导入/导出注册新格式。对于使用的格式具有多个选择(例如从外部剪贴板导入时)的客户端来说,位置十分重要。较小的数字表明较高的优先级,会首先尝试这些转换器。新的格式可能支持导入和/或导出。如果已添加此格式,则会在多个位置中存在。会使用首先找到的格式。

参数

index:int — 要注册的导入转换器类或为 null
 
format:String — 要注册的导出转换器类或为 null
 
importerClass:Class — 标记转换器类的格式字符串
 
exporterClass:Class (default = null) — 转换到剪贴板/从剪贴板转换时用作剪贴板格式的字符串。如果格式不支持剪贴板访问,则使其为 null。
 
clipboardFormat:String (default = null)

export

()方法 
public static function export(source:flashx.textLayout.elements:TextFlow, format:String, conversionType:String):Object

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

将 TextFlow 导出为指定格式。

使用此类提供的静态常量之一、MIME 类型或针对用户定义导出器的用户定义格式来指定 format 参数:

  • TextConverter.TEXT_FIELD_HTML_FORMAT
  • TextConverter.PLAIN_TEXT_FORMAT
  • TextConverter.TEXT_LAYOUT_FORMAT

conversionType 参数中使用 ConversionType 类提供的静态常量之一或针对用户定义导出器的用户定义数据类型,指定所导出数据的类型:

  • ConversionType.STRING_TYPE
  • ConversionType.XML_TYPE

返回指定格式的 TextFlow 形式,否则错误时为 null。

参数

source:flashx.textLayout.elements:TextFlow — 源内容
 
format:String — 输出格式
 
conversionType:String — 所导出数据的类型

返回
Object — 对象 - TextFlow 的导出形式,否则错误时为 null

相关 API 元素

getExporter

()方法 
public static function getExporter(format:String):flashx.textLayout.conversion:ITextExporter

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

创建并返回导出转换器,可使用该转换器从 TextFlow 导出到源字符串或 XML 对象。如果您要执行很多单独的导出,可以使用此函数。这与调用 flashx.textLayout.conversion.TextConverter.export() 等效。

使用此类提供的静态常量之一来指定 format 参数:

  • TextConverter.TEXT_FIELD_HTML_FORMAT
  • TextConverter.PLAIN_TEXT_FORMAT
  • TextConverter.TEXT_LAYOUT_FORMAT

如果已多次添加格式,则会使用首先找到的格式。

参数

format:String — 所导出数据的目标格式

返回
flashx.textLayout.conversion:ITextExporter — 可以按指定格式导出的 ITextExporter 文本导出器

相关 API 元素


示例  ( 如何使用本示例 )

此代码段说明使用 getExporter 方法来执行带格式文本的重复导出。

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 getExporter_example 
    {
        // Serialize the TextFlow into a String
        public function export(textFlow:TextFlow):String
        {
            var exporter:ITextExporter = TextConverter.getExporter(TextConverter.TEXT_LAYOUT_FORMAT);
            return exporter.export(textFlow, ConversionType.STRING_TYPE) as String;
        }
    }
}

getFormatAt

()方法 
public static function getFormatAt(index:int):String

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

返回第 index 个格式的格式名称。

参数

index:int

返回
String

getFormatDescriptorAt

()方法 
public static function getFormatDescriptorAt(index:int):FormatDescriptor

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

返回第 index 个格式的 FormatDescriptor。

参数

index:int

返回
FormatDescriptor

getImporter

()方法 
public static function getImporter(format:String, config:IConfiguration = null):flashx.textLayout.conversion:ITextImporter

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

创建并返回导入转换器,您之后可以使用该转换器从源字符串、XML 对象或任何用户定义的数据格式导入到 TextFlow。如果您需要执行很多单独的导入,或者希望在导入期间处理错误,可使用此方法。这与调用 flashx.textLayout.conversion.TextConverter.importToFlow() 等效。

使用此类提供的静态常量之一来指定 format 参数,或使用 MIME 类型或用户定义的数据格式来指定。

  • TextConverter.TEXT_FIELD_HTML_FORMAT
  • TextConverter.PLAIN_TEXT_FORMAT
  • TextConverter.TEXT_LAYOUT_FORMAT

如果已多次添加格式,则会使用首先找到的格式。

参数

format:String — 源内容的格式。使用 flashx.textLayout.conversion.TextConverter.TEXT_LAYOUT_FORMAT、PLAIN_TEXT_FORMAT、TEXT_FIELD_HTML_FORMAT 等常量、MIME 类型或用户定义的格式。
 
config:IConfiguration (default = null) — 在该导入期间要使用的配置。null 表示采用当前默认值。您也可以通过 ITextImporter.configuration 属性设置配置。

返回
flashx.textLayout.conversion:ITextImporter — 可以导入源数据的 ITextImporter 文本导入器

相关 API 元素


示例  ( 如何使用本示例 )

此代码段演示使用 getImporter 方法来执行带格式文本的重复导入。请注意,在每次调用 importToFlow 初期会清除错误。

package flashx.textLayout.conversion.examples
{
    import flashx.textLayout.conversion.ITextImporter;
    import flashx.textLayout.conversion.TextConverter;
    import flashx.textLayout.elements.TextFlow;
    
    public class getImporter_example 
    {
        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;
        }
    }
}

importToFlow

()方法 
public static function importToFlow(source:Object, format:String, config:IConfiguration = null):flashx.textLayout.elements:TextFlow

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

基于指定格式的源内容创建 TextFlow。

使用此类提供的静态常量之一、MIME 类型来指定 format 参数,或者使用针对用户注册的导入器的用户定义值来指定:

  • TextConverter.TEXT_FIELD_HTML_FORMAT
  • TextConverter.PLAIN_TEXT_FORMAT
  • TextConverter.TEXT_LAYOUT_FORMAT

参数

source:Object — 源内容
 
format:String — 源内容格式
 
config:IConfiguration (default = null) — 创建新的 TextFlow 时要使用的 IConfiguration

返回
flashx.textLayout.elements:TextFlow — 从源中创建的 TextFlow,否则错误时为 null。

相关 API 元素

removeFormat

()方法 
public static function removeFormat(format:String):void

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

删除格式。如果多次添加格式,则仅删除首次找到的格式。

参数

format:String — 要删除的转换器格式字符串

removeFormatAt

()方法 
public static function removeFormatAt(index:int):void

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

删除在索引位置的格式。

参数

index:int — 要删除的格式

常量详细信息

PLAIN_TEXT_FORMAT

常量
public static const PLAIN_TEXT_FORMAT:String = "plainTextFormat"

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

纯文本格式。使用此常量,可基于简单无格式的字符串创建 TextFlow,或基于 TextFlow 创建简单无格式的字符串。

TEXT_FIELD_HTML_FORMAT

常量 
public static const TEXT_FIELD_HTML_FORMAT:String = "textFieldHTMLFormat"

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

HTML 格式。使用此常量,可用 HTML 格式从 TextFlow 导入或导出到 TextFlow。Text Layout Framework HTML 支持 flash.text 包中的 TextField 类所支持的标记和属性子集。

下表列出了对于导入和导出过程支持的 HTML 标记和属性(TextField 支持但 Text Layout Framework 不支持的标记和属性被专门描述为不支持):

标签 说明
锚标签 <a> 标签创建超文本链接并支持以下属性:
  • target:指定加载页面的目标窗口的名称。选项包括 _self_blank_parent_top_self 选项指定当前窗口中的当前帧,_blank 指定一个新窗口,_parent 指定当前帧的父级,而 _top 指定当前窗口中的顶级帧。
  • href:指定一个 URL。该 URL 可以是绝对路径,也可以是相对路径(相对于加载该页的 SWF 文件的位置)。http://www.adobe.com 示例表示对 URL 的绝对引用;/index.html 示例表示相对引用。绝对 URL 必须以 http:// 为前缀,否则 Flash 会将其视为相对 URL。注意:与 TextField 类不同,不支持 ActionScript link 事件。也不支持 a:linka:hovera:active 样式。
粗体标签 <b> 标签以粗体形式呈现文本。粗体必须可用于所使用的字体。
换行标签 <br> 标记将在文本中创建一个换行符。
字体标签 <font> 标签指定一种字体或一个字体列表来显示文本。字体标签支持以下属性:
  • color:只支持十六进制颜色 (#FFFFFF) 值。
  • face:指定要使用的字体的名称。如下例所示,您可以指定一个以逗号分隔的字体名称的列表,在这种情况下,Flash Player 选择第一个可用字体。如果本地计算机系统上未安装指定的字体,或 SWF 文件中未嵌入指定的字体,则 Flash Player 将选择替代字体。
  • size:指定字体的大小。您可以使用绝对像素大小(如 16 或 18),也可以使用相对点值(如 +2 或 -4)。
  • letterspacing:指定应用到每个字符右侧的间距(手动字距微调),以像素为单位。
  • kerning:指定字距微调处于启用状态还是禁用状态。非零值表示启用字距微调,而零表示禁用字距微调。
图像标签 使用 <img> 标记,可将外部图像文件(JPEG、GIF、PNG)、SWF 文件和影片剪辑嵌入到文本中。

<img> 标签支持以下属性:

  • src:指定图像或 SWF 文件的 URL,或库中影片剪辑元件的链接标识符。此属性是必需的,所有其他属性都是可选的。外部文件(JPEG、GIF、PNG 和 SWF 文件)只有在完全下载之后才能显示。
  • width:所插入的图像、SWF 文件或影片剪辑的宽度(以像素为单位)。
  • height:所插入的图像、SWF 文件或影片剪辑的高度(以像素为单位)。

注意:与 TextField 类不同,不支持下列属性:alignhspacevspaceidcheckPolicyFile

斜体标签 <i> 标签以斜体形式显示标签中的文本。斜体必须可用于所使用的字体。
列表项标签 注意:与 TextField 类不同,不支持 List 项标签。
段落标签 <p> 标签创建一个新段落。<p> 标签支持以下属性:
  • align:指定段落内文本的对齐方式;有效值为 leftrightjustifycenter
  • class:指定可以用于设置样式的类名称
Span 标签 <span> 标签支持以下属性:
  • class:指定可用于设置样式的类名称。虽然 span 标签常用于设置样式表中定义的样式,但 TLFTextField 实例不支持样式表。TLFTextField 实例可以使用 span 标签来引用带有样式属性的类。
  • 还可以将属性直接放入 span 标签中:<span fontFamily="Arial">Hi there</span>。但是,系统不支持嵌套的 span 标签。
文本格式标签

使用 <textformat> 标签可在文本字段中使用 TextFormat 类的段落格式设置属性的子集,其中包括行距、缩进、边距和 Tab 停靠位。您可以将 <textformat> 标签与内置 HTML 标签结合使用。

<textformat> 标签具有以下属性:

  • indent:指定从左边距到段落中第一个字符的缩进;对应于 TextFormat.indent。正数和负数均可以接受。
  • blockindent:指定应用于段落所有行的缩进。
  • leftmargin:指定段落的左边距(以点为单位);对应于 TextFormat.leftMargin
  • rightmargin:指定段落的右边距(以点为单位);对应于 TextFormat.rightMargin
  • leading:指定一行的上缘与上一行的下缘之间的像素行距(行高)。
  • tabstops:指定段落的制表位位置以逗号分隔的列表。
下划线标签 <u> 标签为标签文本添加下划线。

未知标签导入时,textFieldHTMLFormat 导入器会将单个 FlowElement 的 typeName 属性设置为此标签名称,或使用被设置为标签名称的 typeName 属性创建 DivElement 或 SubParagraphGroupElement。

typeName 与默认情况不同时,textFieldHTMLFormat 导出器会将其导出为 XML 标签。

相关 API 元素

TEXT_LAYOUT_FORMAT

常量 
public static const TEXT_LAYOUT_FORMAT:String = "textLayoutFormat"

语言版本: ActionScript 3.0
运行时版本: Flash Player 10, AIR 1.5

TextLayout 格式。使用此常量,可用 TextLayout 标记格式从 TextFlow 导入或导出到 TextFlow。文本布局格式将检测下列错误:

  • 意外命名空间
  • 未知元素
  • 未知属性

TextConverter_example.as

此示例演示了 TextConverter 转换类的使用。标准标记格式的文本会导入到 TextFlow 对象中,然后显示。该文本然后以 XML 格式导出。

package flashx.textLayout.conversion.examples 
{
    import flash.display.Sprite;
    import flashx.textLayout.container.ContainerController;
    import flashx.textLayout.elements.TextFlow;
    import flashx.textLayout.conversion.TextConverter;
    import flashx.textLayout.conversion.ConversionType;

    public class TextConverter_example extends Sprite
    {
        public function TextConverter_example()
        {
            var markup:String = "<TextFlow xmlns='http://ns.adobe.com/textLayout/2008'><p><span>Hello, World</span></p></TextFlow>";
            var textFlow:TextFlow = TextConverter.importToFlow(markup, TextConverter.TEXT_LAYOUT_FORMAT);
            textFlow.flowComposer.addController(new ContainerController(this, 200, 50));
            textFlow.flowComposer.updateAllControllers();
            //export to XML
            var xmlOut:XML = TextConverter.export(textFlow,TextConverter.TEXT_LAYOUT_FORMAT, ConversionType.XML_TYPE) as XML;
        }
    }
}




[ X ]为什么显示为英语?
《ActionScript 3.0 参考》中的内容以英语显示

《ActionScript 3.0 参考》中的部分内容未翻译成所有语言。当某个语言元素未翻译时,将显示为英语。例如,ga.controls.HelpBox 类未翻译成任何语言。因此在简体中文版的参考中,ga.controls.HelpBox 类显示为英语。