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

IEditManager  - 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.edit
接口public interface IEditManager extends ISelectionManager , IInteractionEventHandler
实现器 EditManager

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

IEditManager 定义用于处理文本流编辑操作的接口。

要启用文本流编辑功能,请将一个 IEditManager 实例指定给 TextFlow 对象的 interactionManager 属性。编辑管理器可以处理对文本进行的更改(例如插入、删除和更改格式)。如果编辑管理器具有撤消管理器,则可以撤消这些更改。必要时,编辑管理器会触发文本流的重新合成和显示。

相关 API 元素



公共属性
 属性由以下参数定义
 InheritedabsoluteEnd : int
[只读] 选择部分末尾的文本位置,是自文本流起始位置的偏移。
ISelectionManager
 InheritedabsoluteStart : int
[只读] 选择部分开头的文本位置,是自文本流起始位置的偏移。
ISelectionManager
 InheritedactivePosition : int
[只读] 选择部分的活动点。
ISelectionManager
  allowDelayedOperations : Boolean
控制操作是否可以排队等候随后执行。
IEditManager
 InheritedanchorPosition : int
[只读] 选择部分的锚点。
ISelectionManager
 InheritedcurrentSelectionFormat : SelectionFormat
[只读] 当前 SelectionFormat 对象。
ISelectionManager
  delayUpdates : Boolean
默认情况下,调用 IEditManager 会同步处理更新,所以会生成请求的更改,文本会重新合成并添加至 IEditManager 方法的显示列表中。
IEditManager
 InheritededitingMode : String
[只读] 编辑模式。
ISelectionManager
 Inheritedfocused : Boolean
[只读] 指示文本流中的容器是否具有焦点。
ISelectionManager
 InheritedfocusedSelectionFormat : SelectionFormat
用于在焦点容器中绘制选择的 SelectionFormat 对象。
ISelectionManager
 InheritedinactiveSelectionFormat : SelectionFormat
当选择部分不在活动窗口中时,用于绘制选择的 SelectionFormat 对象。
ISelectionManager
 InheritedtextFlow : flashx.textLayout.elements:TextFlow
由该选择管理器管理的 TextFlow 对象。
ISelectionManager
  undoManager : IUndoManager
[只读] 指定给该 EditManager 实例的 UndoManager 对象(如果有)。
IEditManager
 InheritedunfocusedSelectionFormat : SelectionFormat
当选择部分不在焦点容器内但是位于活动窗口中时,用于绘制选择的 SelectionFormat 对象。
ISelectionManager
 InheritedwindowActive : Boolean
[只读] 指示与文本流关联的窗口是否是活动窗口。
ISelectionManager
公共方法
 方法由以下参数定义
 Inherited
处理 activate 事件。
IInteractionEventHandler
  
将容器样式应用于所选项目中的任何容器。
IEditManager
  
更改指定(或当前)选择部分的格式。
IEditManager
  
applyFormatToElement(targetElement:FlowElement, format:flashx.textLayout.formats:ITextLayoutFormat, relativeStart:int = 0, relativeEnd:int = -1, operationState:SelectionState = null):void
将样式应用于指定元素。
IEditManager
  
更改应用于指定(或当前)选择部分中叶元素的格式。
IEditManager
  
applyLink(href:String, target:String = null, extendToLinkBoundary:Boolean = false, operationState:SelectionState = null):LinkElement
将选择部分转换为一个链接,或将链接转换为普通文本。
IEditManager
  
将段落样式应用于所选项目中的任何段落。
IEditManager
  
将文本转换为 TCY 串或将 TCY 串转换为非 TCY 文本。
IEditManager
  
开始一组新操作。
IEditManager
  
changeElementID(newID:String, targetElement:FlowElement, relativeStart:int = 0, relativeEnd:int = -1, operationState:SelectionState = null):void
更改元素的 ID。
IEditManager
  
changeStyleName(newName:String, targetElement:FlowElement, relativeStart:int = 0, relativeEnd:int = -1, operationState:SelectionState = null):void
自以下版本起不推荐使用: 2.0: 请使用 applyFormatToElement
更改整个元素或部分元素的 styleName。
IEditManager
  
changeTypeName(newName:String, targetElement:FlowElement, relativeStart:int = 0, relativeEnd:int = -1, operationState:SelectionState = null):void
更改整个元素或部分元素的 typeName。
IEditManager
  
对指定(或当前)所选项目的格式取消定义。
IEditManager
  
对指定元素的样式取消定义。
IEditManager
  
在同时包含范围的开始和结束点的最低公共父元素位置,创建包含在 operationState 中指定的整个范围的新 DivElement。
IEditManager
  
在同时包含范围的开始和结束点的最低公共父元素位置,创建包含在 operationState 中指定的整个范围的新 ListElement。
IEditManager
  
在同时包含范围的开始和结束点的最低公共父元素位置,创建包含在 operationState 中指定的整个范围的新 SubParagraphGroupElement。
IEditManager
  
删除选择的区域并在 TextScrap 对象中返回删除的区域。
IEditManager
 Inherited
处理 deactivate 事件。
IInteractionEventHandler
  
deleteNextCharacter(operationState:SelectionState = null):void
删除某一范围内的文本,或者,如果进行了点选择,则删除下一个字符。
IEditManager
  
deleteNextWord(operationState:SelectionState = null):void
删除下一个字。
IEditManager
  
删除某一范围内的文本,或者,如果进行了点选择,则删除上一个字符。
IEditManager
  
deletePreviousWord(operationState:SelectionState = null):void
删除上一个字。
IEditManager
  
deleteText(operationState:SelectionState = null):void
删除某一范围内的文本。
IEditManager
  
执行 FlowOperation。
IEditManager
 Inherited
处理 edit 事件。
IInteractionEventHandler
  
结束一组操作。
IEditManager
 Inherited
执行任何挂起的 FlowOperations。
ISelectionManager
 Inherited
处理 focusChange 事件。
IInteractionEventHandler
 Inherited
处理 focusIn 事件。
IInteractionEventHandler
 Inherited
处理 focusOut 事件。
IInteractionEventHandler
 Inherited
获取对于指定的文本范围或当前所选项目中的所有字符都通用的字符格式属性。
ISelectionManager
 Inherited
获取对于指定的文本范围或当前所选项目中的所有容器都通用的容器格式属性。
ISelectionManager
 Inherited
获取对于指定的文本范围或当前选区中的所有段落都通用的段落格式属性。
ISelectionManager
 Inherited
获取当前所选内容的 SelectionState 对象。
ISelectionManager
 Inherited
指示是否进行了选择。
ISelectionManager
 Inherited
处理 imeStartComposition 事件。
IInteractionEventHandler
  
insertInlineGraphic(source:Object, width:Object, height:Object, options:Object = null, operationState:SelectionState = null):InlineGraphicElement
插入图像。
IEditManager
  
insertText(text:String, operationState:SelectionState = null):void
插入文本。
IEditManager
 Inherited
指示选择时是否涵盖某一文本范围。
ISelectionManager
 Inherited
处理 keyDown 事件。
IInteractionEventHandler
 Inherited
处理 keyFocusChange 事件。
IInteractionEventHandler
 Inherited
处理 keyUp 事件。
IInteractionEventHandler
 Inherited
处理 menuSelect 事件。
IInteractionEventHandler
  
modifyInlineGraphic(source:Object, width:Object, height:Object, options:Object = null, operationState:SelectionState = null):void
修改现有内嵌图形。
IEditManager
 Inherited
处理 mouseDoubleClick 事件。
IInteractionEventHandler
 Inherited
处理 mouseDown 事件。
IInteractionEventHandler
 Inherited
处理 mouseMove 事件。
IInteractionEventHandler
 Inherited
处理 mouseOut 事件。
IInteractionEventHandler
 Inherited
处理 mouseOver 事件。
IInteractionEventHandler
 Inherited
处理 mouseUp 事件。
IInteractionEventHandler
 Inherited
处理 mouseWheel 事件。
IInteractionEventHandler
  
moveChildren(source:FlowGroupElement, sourceIndex:int, numChildren:int, destination:FlowGroupElement, destinationIndex:int, operationState:SelectionState = null):void
将一组 FlowElement 从一个 FlowGroupElement 移动至另一个 FlowGroupElement。
IEditManager
 Inherited
notifyInsertOrDelete(absolutePosition:int, length:int):void
插入或删除文本时更新选择管理器。
ISelectionManager
  
overwriteText(text:String, operationState:SelectionState = null):void
覆盖所选文本。
IEditManager
  
将 TextScrap 粘贴到选定区域。
IEditManager
  
执行上一个撤消的操作。
IEditManager
 Inherited
重新显示选择形状。
ISelectionManager
 Inherited
选择整个流。
ISelectionManager
 Inherited
selectRange(anchorPosition:int, activePosition:int):void
选择某一范围的文本。
ISelectionManager
 Inherited
将焦点设置到所选内容中的第一个容器。
ISelectionManager
 Inherited
设置当前选定内容的 SelectionState 对象。
ISelectionManager
 Inherited
处理 softKeyboardActivating 事件
IInteractionEventHandler
  
在指定位置拆分目标元素,同时在当前元素后创建新元素。
IEditManager
  
在当前位置拆分段落,同时在当前段落后创建新段落。
IEditManager
 Inherited
处理 TextEvent。
IInteractionEventHandler
  
恢复上一个操作。
IEditManager
  
在操作对其进行修改后显示。
IEditManager
属性详细信息

allowDelayedOperations

属性
allowDelayedOperations:Boolean

语言版本: ActionScript 3.0
运行时版本: Flash Player 10.2, AIR 2.0

控制操作是否可以排队等候随后执行。

某些操作的执行可能会由于性能优化而延迟。例如,能够方便地将多个键击合并为单个插入操作。如果 allowDelayedOperationstrue,则操作可能需要排队。如果为 false,将立即执行所有操作。默认情况下,此值为 true



实现
    public function get allowDelayedOperations():Boolean
    public function set allowDelayedOperations(value:Boolean):void

相关 API 元素

flashx.edit.ISelectionManager.flushPendingOperations

delayUpdates

属性 
delayUpdates:Boolean

语言版本: ActionScript 3.0
运行时版本: Flash Player 10.2, AIR 2.0

默认情况下,调用 IEditManager 会同步处理更新,所以会生成请求的更改,文本会重新合成并添加至 IEditManager 方法的显示列表中。若要获得延迟的重新绘制,请将 delayUpdates 设置为 true。这会引起 IEditManager 仅更新模型,然后在下一个 enter_frame 事件中重新合成并重新绘制。



实现
    public function get delayUpdates():Boolean
    public function set delayUpdates(value:Boolean):void

undoManager

属性 
undoManager:IUndoManager  [只读]

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

指定给该 EditManager 实例的 UndoManager 对象(如果有)。

撤消管理器可处理撤消和重做操作。



实现
    public function get undoManager():IUndoManager
方法详细信息

applyContainerFormat

()方法
public function applyContainerFormat(format:flashx.textLayout.formats:ITextLayoutFormat, operationState:SelectionState = null):void

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

将容器样式应用于所选项目中的任何容器。

格式对象中所有 null 样式属性将不会改变。

参数

format:flashx.textLayout.formats:ITextLayoutFormat — 要应用于范围内容器的格式
 
operationState:SelectionState (default = null) — 指定该操作所作用的文本;如果为 null,该操作将应用于当前选择内容。


示例  ( 如何使用本示例 )

以下示例更改包含所选项目的容器的格式以显示两个列:
package flashx.textLayout.edit.examples
{
    import flashx.textLayout.edit.IEditManager;
    import flashx.textLayout.edit.SelectionState;
    import flashx.textLayout.elements.TextFlow;
    import flashx.textLayout.formats.TextLayoutFormat;
    
    public class EditManager_applyContainerFormat
    {
        public function EditManager_applyContainerFormat( selection:SelectionState ):void
         {
             var textFlow:TextFlow = selection.textFlow;
             var editManager:IEditManager = textFlow.interactionManager as IEditManager;
             
             var containerStyle:TextLayoutFormat = new TextLayoutFormat();
             containerStyle.columnCount = 2;
             
             editManager.applyContainerFormat( containerStyle );
         }    
    }
}

applyFormat

()方法 
public function applyFormat(leafFormat:flashx.textLayout.formats:ITextLayoutFormat, paragraphFormat:flashx.textLayout.formats:ITextLayoutFormat, containerFormat:flashx.textLayout.formats:ITextLayoutFormat, operationState:SelectionState = null):void

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

更改指定(或当前)选择部分的格式。

执行一个不可撤消的操作,该操作将应用新格式。只应用为 TextLayoutFormat 对象设置的样式属性。格式对象中的未定义属性没有改变。

参数

leafFormat:flashx.textLayout.formats:ITextLayoutFormat — 要应用于叶元素(例如跨距和内嵌图形)的格式。
 
paragraphFormat:flashx.textLayout.formats:ITextLayoutFormat — 要应用于段落元素的格式。
 
containerFormat:flashx.textLayout.formats:ITextLayoutFormat — 要应用于容器的格式。
 
operationState:SelectionState (default = null) — 指定该操作所作用的文本;如果为 null,该操作将应用于当前选择内容。


示例  ( 如何使用本示例 )

以下示例将容器、段落和字符格式应用到所选项目。
 
package flashx.textLayout.edit.examples
{
    import flashx.textLayout.edit.IEditManager;
    import flashx.textLayout.edit.SelectionState;
    import flashx.textLayout.elements.TextFlow;
    import flashx.textLayout.formats.TextAlign;
    import flashx.textLayout.formats.TextLayoutFormat;
    
    public class EditManager_applyFormat
    {
        public function EditManager_applyFormat( selection:SelectionState ):void
        {
            var textFlow:TextFlow = selection.textFlow;
            var editManager:IEditManager = textFlow.interactionManager as IEditManager;
         
            var containerStyle:TextLayoutFormat = new TextLayoutFormat();
            containerStyle.columnCount = 2;
            
            var paraStyle:TextLayoutFormat = new TextLayoutFormat();
            paraStyle.textAlign = TextAlign.JUSTIFY;
            
            var charStyle:TextLayoutFormat = new TextLayoutFormat();
            charStyle.color = 0xff0000;
            
            editManager.applyFormat( charStyle, paraStyle, containerStyle );    
        }
    }
}

applyFormatToElement

()方法 
public function applyFormatToElement(targetElement:FlowElement, format:flashx.textLayout.formats:ITextLayoutFormat, relativeStart:int = 0, relativeEnd:int = -1, operationState:SelectionState = null):void

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

将样式应用于指定元素。

格式对象中所有 null 样式属性将不会改变。只有与指定元素相关的样式才会被应用。

参数

targetElement:FlowElement — 将应用样式的元素。
 
format:flashx.textLayout.formats:ITextLayoutFormat — 包含要应用的样式的格式。
 
relativeStart:int (default = 0) — 分配新格式时,距离拆分元素时所在的元素开头的偏移。
 
relativeEnd:int (default = -1) — 应用新格式时,距离拆分元素时所在的元素开头的偏移。
 
operationState:SelectionState (default = null) — 指定该操作所作用的文本;如果为 null,该操作将应用于当前选择内容。


示例  ( 如何使用本示例 )

下面的示例对流元素层次结构中间级别中的 <div> 元素应用格式。
package flashx.textLayout.edit.examples
{
    import flashx.textLayout.conversion.TextConverter;
    import flashx.textLayout.edit.IEditManager;
    import flashx.textLayout.edit.SelectionState;
    import flashx.textLayout.elements.FlowElement;
    import flashx.textLayout.elements.TextFlow;
    import flashx.textLayout.formats.TextLayoutFormat;
    
    public class EditManager_applyFormatToElement
    {
        public function EditManager_applyFormatToElement( selection:SelectionState ):void
        {
            var textFlow:TextFlow = TextConverter.importToFlow("<TextFlow><div><p><span>Hello World</span></p></div><p>No indent</p></TextFlow>", TextConverter.TEXT_LAYOUT_FORMAT);
            var editManager:IEditManager = textFlow.interactionManager as IEditManager;
            var divElement:FlowElement = textFlow.getChildAt(0);
            
            var format:TextLayoutFormat = new TextLayoutFormat();
            format.textIndent = 15;
            
            
            editManager.applyFormatToElement( divElement, format );    
        }
    }
}

applyLeafFormat

()方法 
public function applyLeafFormat(format:flashx.textLayout.formats:ITextLayoutFormat, operationState:SelectionState = null):void

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

更改应用于指定(或当前)选择部分中叶元素的格式。

执行一个不可撤消的操作,该操作将新格式应用于叶元素,例如 SpanElement 和 InlineGraphicElement 对象。只应用为 TextLayoutFormat 对象设置的样式属性。格式对象中的未定义属性已改变。

参数

format:flashx.textLayout.formats:ITextLayoutFormat — 要应用的格式。
 
operationState:SelectionState (default = null) — 指定该操作所作用的文本;如果为 null,该操作将应用于当前选择内容。


示例  ( 如何使用本示例 )

以下示例将所选项目中文本的颜色更改为红色。
package flashx.textLayout.edit.examples
{
    import flashx.textLayout.edit.IEditManager;
    import flashx.textLayout.edit.SelectionState;
    import flashx.textLayout.elements.TextFlow;
    import flashx.textLayout.formats.TextLayoutFormat;
    
    public class EditManager_applyLeafFormat
    {
        public function EditManager_applyLeafFormat(selection:SelectionState)
        {
             var textFlow:TextFlow = selection.textFlow;
             var editManager:IEditManager = textFlow.interactionManager as IEditManager;
        
             var charStyle:TextLayoutFormat = new TextLayoutFormat();
             charStyle.color = 0xff0000;
             
             editManager.applyLeafFormat( charStyle );    
        }
    }
}

applyLink

()方法 
public function applyLink(href:String, target:String = null, extendToLinkBoundary:Boolean = false, operationState:SelectionState = null):LinkElement

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

将选择部分转换为一个链接,或将链接转换为普通文本。

执行一个创建或删除链接的不可撤消的操作。

如果指定了 target 参数,则必须为下列值之一:

  • "_self"
  • "_blank"
  • "_parent"
  • "_top"

在浏览器承载的运行时中,目标为 "_self" 时将替换当前的 html 页。因此,如果包含链接的 SWF 内容位于某页中的一个框架或框架集内,则链接的内容将加载在该框架内。如果页面位于顶层,则链接的内容打开时会替换原始页。目标为 "_blank" 时将打开一个新的浏览器窗口(未命名)。目标为 "_parent" 时将替换包含 SWF 内容的 html 页的父代。目标为 "_top" 时将替换当前浏览器窗口中的顶层页。

在其它运行时中,例如 Adobe AIR 中,链接在用户的默认浏览器中打开,并忽略 target 参数。

extendToLinkBoundary 参数确定编辑管理器如何处理与一个或多个现有链接相交的选择部分。如果该参数为 true,则该操作作为一个单元应同时应用于选择部分及现有链接的全部文本。因此,将会创建单个链接,范围从相交的第一个链接开头开始,到相交的最后一个链接末尾为止。与此相反,如果在此情况下 extendToLinkBoundaryfalse,则当前部分选择的链接将会拆分为两个链接。

参数

href:String — 链接引用的 URI。
 
target:String (default = null) — 链接的目标浏览器窗口。
 
extendToLinkBoundary:Boolean (default = false) — 指定是否使用任何现有链接进行重叠来巩固选择,然后应用更改。
 
operationState:SelectionState (default = null) — 指定该操作所作用的文本;如果为 null,该操作将应用于当前选择内容。

返回
LinkElement — 已创建的 LinkElement。

相关 API 元素


示例  ( 如何使用本示例 )

以下示例定义了两个函数。第一个函数将选择部分转换为链接。第二个函数从链接删除 URL。
package flashx.textLayout.edit.examples
{
    import flash.display.Sprite;
    
    import flashx.textLayout.container.ContainerController;
    import flashx.textLayout.conversion.TextConverter;
    import flashx.textLayout.edit.IEditManager;
    import flashx.textLayout.edit.SelectionState;
    import flashx.textLayout.elements.TextFlow;
    
    public class EditManager_applyLink
    {
        
        static public function makeLink( selection:SelectionState ):void
         {
             var textFlow:TextFlow = selection.textFlow;
             var editManager:IEditManager = textFlow.interactionManager as IEditManager;
                 
             editManager.applyLink( "http://www.adobe.com" );
         }
         
        static public function removeLink( selection:SelectionState ):void
         {
            var textFlow:TextFlow = selection.textFlow;
            var editManager:IEditManager = textFlow.interactionManager as IEditManager;
            
            editManager.applyLink( null, null, true );    
         }
    }
}

applyParagraphFormat

()方法 
public function applyParagraphFormat(format:flashx.textLayout.formats:ITextLayoutFormat, operationState:SelectionState = null):void

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

将段落样式应用于所选项目中的任何段落。

格式对象中所有 null 样式属性将不会改变。

参数

format:flashx.textLayout.formats:ITextLayoutFormat — 要应用于所选段落的格式。
 
operationState:SelectionState (default = null) — 指定该操作所作用的文本;如果为 null,该操作将应用于当前选择内容。


示例  ( 如何使用本示例 )

以下示例定义一个函数以更改当前选择中包含的任何段落的格式,从而将文本两端对齐。
package flashx.textLayout.edit.examples
{
    import flashx.textLayout.edit.IEditManager;
    import flashx.textLayout.edit.SelectionState;
    import flashx.textLayout.elements.TextFlow;
    import flashx.textLayout.formats.TextAlign;
    import flashx.textLayout.formats.TextLayoutFormat;
    
    public class EditManager_applyParagraphFormat
    {
        static public function justifyParagraph( selection:SelectionState ):void
         {
            var textFlow:TextFlow = selection.textFlow;
            var editManager:IEditManager = textFlow.interactionManager as IEditManager;
         
             var paraStyle:TextLayoutFormat = new TextLayoutFormat();
             paraStyle.textAlign = TextAlign.JUSTIFY;
         
             editManager.applyParagraphFormat( paraStyle );    
         }
    }
}

applyTCY

()方法 
public function applyTCY(tcyOn:Boolean, operationState:SelectionState = null):flashx.textLayout.elements:TCYElement

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

将文本转换为 TCY 串或将 TCY 串转换为非 TCY 文本。

日语文本中的 TCY(表示 tate-chuu-yoko)可使文本在一个垂直行内水平绘制,并用于提高非日文文本或数字(例如日期)的小文本块在垂直文本中的可读性。

参数

tcyOn:Boolean — 设置为 true 时会将 TCY 应用于文本范围,指定为 false 时会删除 TCY。
 
operationState:SelectionState (default = null) — 指定该操作所作用的文本;如果为 null,该操作将应用于当前选择内容。

返回
flashx.textLayout.elements:TCYElement — 已创建的 TCYElement。

相关 API 元素


示例  ( 如何使用本示例 )

以下示例定义了两个函数。第一个函数将 TCY 格式应用于当前选择。第二个函数删除 TCY 格式。
package flashx.textLayout.edit.examples
{
    import flashx.textLayout.edit.IEditManager;
    import flashx.textLayout.edit.SelectionState;
    import flashx.textLayout.elements.TextFlow;
    
    public class EditManager_applyTCY
    {
        static public function tcyOn( selection:SelectionState ):void
         {
            var textFlow:TextFlow = selection.textFlow;
            var editManager:IEditManager = textFlow.interactionManager as IEditManager;
        
             editManager.applyTCY( true );
         }
         
        static public function tcyOff( selection:SelectionState ):void
         {
        
            var textFlow:TextFlow = selection.textFlow;
            var editManager:IEditManager = textFlow.interactionManager as IEditManager;
        
             editManager.applyTCY( false );    
         }
    }
}

beginCompositeOperation

()方法 
public function beginCompositeOperation():void

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

开始一组新操作。

在调用 beginCompositeOperation() 之后及调用对应的 endCompositeOperation() 之前执行的所有操作,将作为单个操作执行和成组,该操作可作为一个单元撤消。

beginCompositeOperation/endCompositeOperation 块可以嵌入在其它 beginCompositeOperation/endCompositeOperation 块中。

相关 API 元素

flashx.textLayout.edit.IEditManager.endCompositeOperation

示例  ( 如何使用本示例 )

以下示例定义一个函数,用于将图形对象插入到它自己的段落中。如果未使用 beginCompositeOperation()endCompositeOperation() 函数,则其中每个子操作将必须单独撤消而不是作为一个组撤消。
package flashx.textLayout.edit.examples
{
    import flashx.textLayout.edit.IEditManager;
    import flashx.textLayout.edit.SelectionState;
    import flashx.textLayout.elements.TextFlow;
    
    public class EditManager_beginCompositeOperation
    {
        static public function insertGraphic( source:Object, width:Object, height:Object, float:String, selection:SelectionState ):void
        {
            var editManager:IEditManager = selection.textFlow.interactionManager as IEditManager;
            
            editManager.beginCompositeOperation();
            
            editManager.deleteText( selection );
            var changedSelection:SelectionState = 
                new SelectionState( selection.textFlow, selection.anchorPosition, selection.anchorPosition );
            editManager.splitParagraph( changedSelection );
            changedSelection = 
                new SelectionState( changedSelection.textFlow, changedSelection.anchorPosition + 1, changedSelection.anchorPosition + 1);
            editManager.insertInlineGraphic( source, width, height, float, changedSelection );
            changedSelection = 
                new SelectionState( changedSelection.textFlow, changedSelection.anchorPosition + 1, changedSelection.anchorPosition + 1);
            editManager.splitParagraph( changedSelection );
            
            editManager.endCompositeOperation();                
        }
    }
}

changeElementID

()方法 
public function changeElementID(newID:String, targetElement:FlowElement, relativeStart:int = 0, relativeEnd:int = -1, operationState:SelectionState = null):void

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

更改元素的 ID。

如果将 relativeStartrelativeEnd 参数设置为非默认值,则会拆分元素。位于该范围之外的元素部分将保留原始 ID。设置 relativeStartrelativeEnd 参数将使用重复的 ID 创建元素。

参数

newID:String — 新 ID 值。
 
targetElement:FlowElement — 要修改的元素。
 
relativeStart:int (default = 0) — 指定新 ID 时,距离拆分元素时所在的元素开头的偏移。
 
relativeEnd:int (default = -1) — 指定新 ID 时,距离拆分元素时所在的元素开头的偏移。
 
operationState:SelectionState (default = null) — 指定撤消此操作时要还原的当前选择;如果为 null,则该操作会保存当前选择。


示例  ( 如何使用本示例 )

以下示例定义一个函数,用于更改选择部分中第一个段落的 ID:
package flashx.textLayout.edit.examples
{
    import flashx.textLayout.edit.ElementRange;
    import flashx.textLayout.edit.IEditManager;
    import flashx.textLayout.edit.SelectionState;
    import flashx.textLayout.elements.TextFlow;
    
    public class EditManager_changeElementID
    {
        static public function changeParagraphID( id:String, selection:SelectionState ):void
         {
            var textFlow:TextFlow = selection.textFlow;
            var editManager:IEditManager = textFlow.interactionManager as IEditManager;
            var selectedRange:ElementRange = ElementRange.createElementRange( selection.textFlow, selection.absoluteStart, selection.absoluteEnd );            
        
            editManager.changeElementID( id, selectedRange.firstParagraph, 0, -1, selection );    
         }
    }
}

         

changeStyleName

()方法 
public function changeStyleName(newName:String, targetElement:FlowElement, relativeStart:int = 0, relativeEnd:int = -1, operationState:SelectionState = null):void
自以下版本起不推荐使用: 2.0: 请使用 applyFormatToElement

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

更改整个元素或部分元素的 styleName。

如果将 relativeStartrelativeEnd 参数设置为非默认值,则会拆分元素。位于该范围之外的元素部分将保留原始样式。

参数

newName:String — 新样式的名称。
 
targetElement:FlowElement — 指定要更改的元素。
 
relativeStart:int (default = 0) — 指定新样式时,距离拆分元素时所在的元素开头的偏移。
 
relativeEnd:int (default = -1) — 指定新样式时,距离拆分元素时所在的元素末尾的偏移。
 
operationState:SelectionState (default = null) — 指定撤消此操作时要还原的当前选择;如果为 null,则该操作会保存当前选择。


示例  ( 如何使用本示例 )

下例定义了更改所选项目第一段样式名称的函数:
package flashx.textLayout.edit.examples
{
    import flashx.textLayout.edit.ElementRange;
    import flashx.textLayout.edit.IEditManager;
    import flashx.textLayout.edit.SelectionState;
    import flashx.textLayout.elements.TextFlow;
    
    public class EditManager_changeStyleName
    {
        static public function changeParagraphStyle( styleName:String, selection:SelectionState ):void
        {
            var textFlow:TextFlow = selection.textFlow;
            var editManager:IEditManager = textFlow.interactionManager as IEditManager;
            var selectedRange:ElementRange = ElementRange.createElementRange( selection.textFlow, selection.absoluteStart, selection.absoluteEnd );            
        
            editManager.changeElementID( styleName, selectedRange.firstParagraph, 0, -1, selection );    
        }
    }
}

changeTypeName

()方法 
public function changeTypeName(newName:String, targetElement:FlowElement, relativeStart:int = 0, relativeEnd:int = -1, operationState:SelectionState = null):void

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

更改整个元素或部分元素的 typeName。

如果将 relativeStartrelativeEnd 参数设置为非默认值,则会拆分元素。位于该范围之外的元素部分将保留原始样式。

参数

newName:String — 新类型的名称。
 
targetElement:FlowElement — 指定要更改的元素。
 
relativeStart:int (default = 0) — 指定新样式时,距离拆分元素时所在的元素开头的偏移
 
relativeEnd:int (default = -1) — 指定新样式时,距离拆分元素时所在的元素末尾的偏移
 
operationState:SelectionState (default = null) — 指定撤消此操作时要还原的当前选择;如果为 null,则该操作会保存当前选择。

clearFormat

()方法 
public function clearFormat(leafFormat:flashx.textLayout.formats:ITextLayoutFormat, paragraphFormat:flashx.textLayout.formats:ITextLayoutFormat, containerFormat:flashx.textLayout.formats:ITextLayoutFormat, operationState:SelectionState = null):void

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

对指定(或当前)所选项目的格式取消定义。

执行一个不可撤消的操作,该操作对指定格式取消定义。只应用为 TextLayoutFormat 对象设置的样式属性。格式对象中的未定义属性没有改变。

参数

leafFormat:flashx.textLayout.formats:ITextLayoutFormat — 一种格式,其设置值指示用于取消定义选定范围中 LeafFlowElement 对象的属性。
 
paragraphFormat:flashx.textLayout.formats:ITextLayoutFormat — 其设置的值指示对所选范围内的 ParagraphElement 对象取消定义的属性的格式。
 
containerFormat:flashx.textLayout.formats:ITextLayoutFormat — 其设置的值指示对所选范围内的 ContainerController 对象取消定义的属性的格式。
 
operationState:SelectionState (default = null) — 指定该操作所作用的文本;如果为 null,该操作将应用于当前选择内容。

clearFormatOnElement

()方法 
public function clearFormatOnElement(targetElement:FlowElement, format:flashx.textLayout.formats:ITextLayoutFormat, operationState:SelectionState = null):void

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

对指定元素的样式取消定义。

格式对象中所有 undefined 的样式属性将保持不变。在指定的格式中定义的任何样式都未在指定的元素上定义。

参数

targetElement:FlowElement — 将应用样式的元素。
 
format:flashx.textLayout.formats:ITextLayoutFormat — 包含要取消定义的样式的格式。
 
operationState:SelectionState (default = null) — 指定该操作所作用的文本;如果为 null,该操作将应用于当前选择内容。

createDiv

()方法 
public function createDiv(parent:FlowGroupElement = null, format:flashx.textLayout.formats:ITextLayoutFormat = null, operationState:SelectionState = null):DivElement

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

在同时包含范围的开始和结束点的最低公共父元素位置,创建包含在 operationState 中指定的整个范围的新 DivElement。如果开始和结束点是相同的,则会在此位置使用单个子段落创建新的 DivElement。

参数

parent:FlowGroupElement (default = null) — 为新的 DivElement 指定父代元素。如果为 null,则新的父代是包含 SelectionState 的最低级别。
 
format:flashx.textLayout.formats:ITextLayoutFormat (default = null) — 应用于新 DivElement 的格式属性。
 
operationState:SelectionState (default = null) — 指定该操作所作用的文本;如果为 null,该操作将应用于当前选择内容。

返回
DivElement — 已创建的新 DivElement.

createList

()方法 
public function createList(parent:FlowGroupElement = null, format:flashx.textLayout.formats:ITextLayoutFormat = null, operationState:SelectionState = null):ListElement

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

在同时包含范围的开始和结束点的最低公共父元素位置,创建包含在 operationState 中指定的整个范围的新 ListElement。范围中的每个段落会成为新 ListElement 中的 ListItemElement。如果开始和结束点是相同的,则会在此位置使用单个 ListItemElement 子代创建新 ListElement。

参数

parent:FlowGroupElement (default = null) — 为新的 ListElement 指定父代元素(可选)。如果为 null,则新的父代是包含 SelectionState 的最低级别。
 
format:flashx.textLayout.formats:ITextLayoutFormat (default = null) — 应用于新 ListElement 的格式属性。
 
operationState:SelectionState (default = null) — 指定该操作所作用的文本;如果为 null,该操作将应用于当前选择内容。

返回
ListElement — 已创建的新 ListElement.

createSubParagraphGroup

()方法 
public function createSubParagraphGroup(parent:FlowGroupElement = null, format:flashx.textLayout.formats:ITextLayoutFormat = null, operationState:SelectionState = null):SubParagraphGroupElement

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

在同时包含范围的开始和结束点的最低公共父元素位置,创建包含在 operationState 中指定的整个范围的新 SubParagraphGroupElement。如果开始和结束点相同,则无操作。

参数

parent:FlowGroupElement (default = null) — 为新的 SubParagraphGroupElement 元素指定父代元素。如果为 null,则新的父代是包含 SelectionState 的最低级别。
 
format:flashx.textLayout.formats:ITextLayoutFormat (default = null) — 应用于新 SubParagraphGroupElement 的格式属性
 
operationState:SelectionState (default = null) — 指定该操作所作用的文本;如果为 null,该操作将应用于当前选择内容。

返回
SubParagraphGroupElement — 已创建的新 SubParagraphGroupElement.

cutTextScrap

()方法 
public function cutTextScrap(operationState:SelectionState = null):flashx.textLayout.edit:TextScrap

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

删除选择的区域并在 TextScrap 对象中返回删除的区域。

生成的 TextScrap 可以发布到系统剪贴板或用于后续的 pasteTextOperation() 操作中。

参数

operationState:SelectionState (default = null) — 指定该操作所作用的文本;如果为 null,该操作将应用于当前选择内容。

返回
flashx.textLayout.edit:TextScrap — 剪切的 TextScrap。

相关 API 元素

flashx.textLayout.edit.IEditManager.pasteTextScrap
flashx.textLayout.edit.TextClipboard.setContents

示例  ( 如何使用本示例 )

以下示例在文本流中创建选择,剪切选定范围并创建包含已删除内容的 TextScrap 对象。
package flashx.textLayout.edit.examples
{
    import flash.display.Sprite;
    
    import flashx.textLayout.container.ContainerController;
    import flashx.textLayout.conversion.TextConverter;
    import flashx.textLayout.edit.EditManager;
    import flashx.textLayout.edit.TextScrap;
    import flashx.undo.UndoManager;
    import flashx.textLayout.elements.TextFlow;

    public class EditManager_cutTextScrap
    {
        static public function cutTextScrap():TextScrap
        {
            var textFlow:TextFlow = TextConverter.importToFlow( "How do now brown cow.", TextConverter.PLAIN_TEXT_FORMAT );
            textFlow.flowComposer.addController( new ContainerController( new Sprite() ));
            var editManager:EditManager = new EditManager( new UndoManager() );
            textFlow.interactionManager = editManager;
            textFlow.flowComposer.updateAllControllers();
            
            editManager.selectRange( 4, 7 );
            var scrap:TextScrap = editManager.cutTextScrap(); //Displays: How now brown cow.
            return scrap;
        }
    }
}

deleteNextCharacter

()方法 
public function deleteNextCharacter(operationState:SelectionState = null):void

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

删除某一范围内的文本,或者,如果进行了点选择,则删除下一个字符。

参数

operationState:SelectionState (default = null) — 指定该操作所作用的文本;如果为 null,该操作将应用于当前选择内容。


示例  ( 如何使用本示例 )

以下示例在文本流中创建一个点选择并删除下一个字符。
package flashx.textLayout.edit.examples
{
    import flash.display.Sprite;
    
    import flashx.textLayout.container.ContainerController;
    import flashx.textLayout.conversion.TextConverter;
    import flashx.textLayout.edit.EditManager;
    import flashx.textLayout.elements.TextFlow;
    
    public class EditManager_deleteNextCharacter
    {
        static public function deleteNextCharacter():void
        {
            var textFlow:TextFlow = TextConverter.importToFlow( "How now brown crow.", TextConverter.PLAIN_TEXT_FORMAT );
            textFlow.flowComposer.addController( new ContainerController( new Sprite() ));
            var editManager:EditManager = new EditManager();
            textFlow.interactionManager = editManager;
            textFlow.flowComposer.updateAllControllers();
            
            editManager.selectRange( 15, 15 );
            editManager.deleteNextCharacter(); //displays: How now brown cow.
        }
    }
}

deleteNextWord

()方法 
public function deleteNextWord(operationState:SelectionState = null):void

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

删除下一个字。

如果选择了一个范围,则会删除该范围内的第一个字。

参数

operationState:SelectionState (default = null) — 指定该操作所作用的文本;如果为 null,该操作将应用于当前选择内容。


示例  ( 如何使用本示例 )

下例在文本流中创建了一个点选择,并删除了下一个词语。
package flashx.textLayout.edit.examples
{
    import flash.display.Sprite;
    
    import flashx.textLayout.container.ContainerController;
    import flashx.textLayout.conversion.TextConverter;
    import flashx.textLayout.edit.EditManager;
    import flashx.textLayout.elements.TextFlow;
    
    public class EditManager_deleteNextWord
    {
        static public function deleteNextWord():void
        {
            var textFlow:TextFlow = TextConverter.importToFlow( "How do now brown cow.", TextConverter.PLAIN_TEXT_FORMAT );
            textFlow.flowComposer.addController( new ContainerController( new Sprite() ));
            var editManager:EditManager = new EditManager();
            textFlow.interactionManager = editManager;
            textFlow.flowComposer.updateAllControllers();
            
            editManager.selectRange( 3, 3 );
            editManager.deleteNextWord(); //displays: How now brown cow.
        }
    }
}

deletePreviousCharacter

()方法 
public function deletePreviousCharacter(operationState:SelectionState = null):void

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

删除某一范围内的文本,或者,如果进行了点选择,则删除上一个字符。

参数

operationState:SelectionState (default = null) — 指定该操作所作用的文本;如果为 null,该操作将应用于当前选择内容。


示例  ( 如何使用本示例 )

下例在文本流中创建了一个点选择,并删除了上一个字符。
package flashx.textLayout.edit.examples
{
    import flash.display.Sprite;
    
    import flashx.textLayout.container.ContainerController;
    import flashx.textLayout.conversion.TextConverter;
    import flashx.textLayout.edit.EditManager;
    import flashx.textLayout.elements.TextFlow;
    
    public class EditManager_deletePreviousCharacter
    {
        
        static public function deletePreviousCharacter():void
        {
            var textFlow:TextFlow = TextConverter.importToFlow( "How now brown crow.", TextConverter.PLAIN_TEXT_FORMAT );
            textFlow.flowComposer.addController( new ContainerController( new Sprite() ));
            var editManager:EditManager = new EditManager();
            textFlow.interactionManager = editManager;
            textFlow.flowComposer.updateAllControllers();
            
            editManager.selectRange( 16, 16 );
            editManager.deletePreviousCharacter(); //displays: How now brown cow.
        }
    }
}

deletePreviousWord

()方法 
public function deletePreviousWord(operationState:SelectionState = null):void

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

删除上一个字。

如果选择了一个范围,则会删除该范围内的第一个字。

参数

operationState:SelectionState (default = null) — 指定该操作所作用的文本;如果为 null,该操作将应用于当前选择内容。


示例  ( 如何使用本示例 )

下例在文本流中创建了一个点选择,并删除了上一个词语。
var textFlow:TextFlow = TextConverter.importToFlow( "How do now brown cow.", TextConverter.PLAIN_TEXT_FORMAT );
textFlow.flowComposer = new StandardFlowComposer();
textFlow.flowComposer.addController( new ContainerController( this ));
var editManager:EditManager = new EditManager( new UndoManager() );
textFlow.interactionManager = editManager;
textFlow.flowComposer.updateAllControllers();

editManager.setSelection( 7, 7 );
editManager.deletePreviousWord(); //displays: How now brown cow.

deleteText

()方法 
public function deleteText(operationState:SelectionState = null):void

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

删除某一范围内的文本。

参数

operationState:SelectionState (default = null) — 指定该操作所作用的文本;如果为 null,该操作将应用于当前选择内容。


示例  ( 如何使用本示例 )

以下示例在文本流中创建一个范围选择并删除选定的字符。
package flashx.textLayout.edit.examples
{
    import flash.display.Sprite;
    
    import flashx.textLayout.container.ContainerController;
    import flashx.textLayout.conversion.TextConverter;
    import flashx.textLayout.edit.EditManager;
    import flashx.textLayout.elements.TextFlow;
    
    public class EditManager_deleteText
    {
        static public function deleteText():void
        {
            var textFlow:TextFlow = TextConverter.importToFlow( "How do now brown cow.", TextConverter.PLAIN_TEXT_FORMAT );
            textFlow.flowComposer.addController( new ContainerController( new Sprite() ));
            var editManager:EditManager = new EditManager();
            textFlow.interactionManager = editManager;
            textFlow.flowComposer.updateAllControllers();
            
            editManager.selectRange( 4, 7 );
            editManager.deleteText(); //displays: How now brown cow.
        }
    }
}

doOperation

()方法 
public function doOperation(operation:FlowOperation):void

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

执行 FlowOperation。

doOperation() 方法由更新文本流的 IEditManager 函数调用。您通常不需要直接调用该函数,除非要创建自定义操作。

该函数继续执行下列步骤:

  1. 在执行该操作之前刷新任何挂起的操作。
  2. 发送可取消的 flowOperationBegin 事件。如果取消,则该方法立即返回。
  3. 执行该操作。该操作返回 truefalseFalse 表明没有进行任何更改。
  4. 将操作推入到撤消堆栈中。
  5. 清除重做堆栈。
  6. 更新显示。
  7. 发送可取消的 flowOperationEnd 事件。

异常处理:如果该操作引发异常,则会被捕获,而错误将附加到 flowOperationEnd 事件。如果未取消该错误,将会重新引发错误。

参数

operation:FlowOperation — FlowOperation 对象


示例  ( 如何使用本示例 )

以下示例创建和执行 InsertTextOperation:
package flashx.textLayout.edit.examples
{
    import flash.display.Sprite;
    
    import flashx.textLayout.container.ContainerController;
    import flashx.textLayout.conversion.TextConverter;
    import flashx.textLayout.edit.EditManager;
    import flashx.textLayout.edit.SelectionState;
    import flashx.textLayout.elements.TextFlow;
    import flashx.textLayout.operations.InsertTextOperation;
    
    public class EditManager_doOperation
    {
        static public function doOperation(sprite:Sprite):void
        {
            var textFlow:TextFlow = TextConverter.importToFlow( "How brown cow.", TextConverter.PLAIN_TEXT_FORMAT );
            textFlow.flowComposer.addController( new ContainerController( sprite ));
            var editManager:EditManager = new EditManager();
            textFlow.interactionManager = editManager;
            textFlow.flowComposer.updateAllControllers();
            
            var selectionState:SelectionState = new SelectionState(textFlow, 4, 4);            
            var insertOperation:InsertTextOperation = new InsertTextOperation( selectionState, "now " );
            editManager.doOperation( insertOperation );        // displays: How now brown cow
        }
    }
}

endCompositeOperation

()方法 
public function endCompositeOperation():void

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

结束一组操作。

自上一个 beginCompositeOperation() 调用后执行的所有操作将组成为一个 CompositeOperation,然后完成该复合操作。该 CompositeOperation 对象会添加到撤消堆栈中,或者,如果该复合操作嵌入在其它复合操作中,则会添加到该父操作。

相关 API 元素

flashx.textLayout.edit.IEditManager.beginCompositeOperation

insertInlineGraphic

()方法 
public function insertInlineGraphic(source:Object, width:Object, height:Object, options:Object = null, operationState:SelectionState = null):InlineGraphicElement

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

插入图像。

图像的源可以是包含 URI 的字符串、URLRequest 对象、表示嵌入资源的 Class 对象或 DisplayObject 实例。

宽度和高度值可以是像素数、百分比或字符串“auto”,在此情况下将使用图形的实际尺寸。

float 设置为 Float 类中定义的一个常量,以指定图像应显示在任何文本的左侧或右侧还是嵌入在文本中。

参数

source:Object — 可以是解释为 URI 的 String、解释为 Embed DisplayObject 类的 Class、DisplayObject 实例或 URLRequest。
 
width:Object — 要插入的图像的宽度(数字、百分比或“auto”)。
 
height:Object — 要插入的图像的高度(数字、百分比或“auto”)。
 
options:Object (default = null) — 全不支持.
 
operationState:SelectionState (default = null) — 指定该操作所作用的文本;如果为 null,该操作将应用于当前选择内容。

返回
InlineGraphicElement

相关 API 元素


示例  ( 如何使用本示例 )

以下示例在文本流的开头插入一个 Shape 对象:
package flashx.textLayout.edit.examples
{
    import flash.display.Shape;
    import flash.display.Sprite;
    
    import flashx.textLayout.container.ContainerController;
    import flashx.textLayout.conversion.TextConverter;
    import flashx.textLayout.edit.EditManager;
    import flashx.textLayout.elements.TextFlow;
    import flashx.undo.UndoManager;
    
    public class EditManager_insertInlineGraphic
    {
        static public function insertInlineGraphic(sprite:Sprite):void
        {
            var textFlow:TextFlow = TextConverter.importToFlow( "How now brown cow.", TextConverter.PLAIN_TEXT_FORMAT );
            textFlow.flowComposer.addController( new ContainerController( sprite ));
            var editManager:EditManager = new EditManager( new UndoManager() );
            textFlow.interactionManager = editManager;
            textFlow.flowComposer.updateAllControllers();
            
            editManager.selectRange( 0, 0 );
            editManager.insertInlineGraphic( createGraphic(), 6, 6, "none" );
            
        }
        static private function createGraphic():Shape
        {
            var shape:Shape = new Shape();
            shape.graphics.beginFill( 0x993366 );
            shape.graphics.drawCircle( 5, 4, 6 );
            return shape;
        }

    }
}

insertText

()方法 
public function insertText(text:String, operationState:SelectionState = null):void

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

插入文本。

在文本中某一位置或范围内插入文本。如果 operationState 参数提供的位置是一个范围(或者该参数为 null 而当前选择内容是一个范围),则当前位于该范围内的文本将被插入的文本替换。

参数

text:String — 要插入的字符串。
 
operationState:SelectionState (default = null) — 指定该操作所作用的流中文本;如果为 null,则该操作将应用于当前选择内容。


示例  ( 如何使用本示例 )

以下示例创建和执行 InsertTextOperation:
 
package flashx.textLayout.edit.examples
{
    import flash.display.Sprite;
    
    import flashx.textLayout.container.ContainerController;
    import flashx.textLayout.conversion.TextConverter;
    import flashx.textLayout.edit.EditManager;
    import flashx.textLayout.elements.TextFlow;
    import flashx.undo.UndoManager;
    
    public class EditManager_insertText
    {
        static public function insertText(sprite:Sprite):void
        {
            var textFlow:TextFlow = TextConverter.importToFlow( "How brown cow.", TextConverter.PLAIN_TEXT_FORMAT );
            textFlow.flowComposer.addController( new ContainerController( sprite ));
            var editManager:EditManager = new EditManager( new UndoManager() );
            textFlow.interactionManager = editManager;
            textFlow.flowComposer.updateAllControllers();
            
            editManager.selectRange( 4, 4 );
            editManager.insertText( "now " );
        }
    }
}

modifyInlineGraphic

()方法 
public function modifyInlineGraphic(source:Object, width:Object, height:Object, options:Object = null, operationState:SelectionState = null):void

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

修改现有内嵌图形。

将无变化的属性设置为原始图形中的值。(修改现有图形对象通常比删除并重新创建一个图形对象效率更高。)

参数

source:Object — 可以是解释为 URI 的 String、解释为 Embed DisplayObject 类的 Class、DisplayObject 实例或 URLRequest。
 
width:Object — 图像的新宽度(数字或百分比)。
 
height:Object — 图像的新高度(数字或百分比)。
 
options:Object (default = null) — 全不支持.
 
operationState:SelectionState (default = null) — 指定该操作所作用的文本;如果为 null,该操作将应用于当前选择内容。

相关 API 元素


示例  ( 如何使用本示例 )

以下示例在文本流的开头插入一个圆,然后更改该内嵌图形的 widthheight 属性以将其拉伸为一个椭圆:
package flashx.textLayout.edit.examples
{
    import flash.display.Sprite;
    import flash.display.Shape;
    
    import flashx.textLayout.container.ContainerController;
    import flashx.textLayout.conversion.TextConverter;
    import flashx.textLayout.edit.EditManager;
    import flashx.textLayout.elements.TextFlow;
    import flashx.undo.UndoManager;
    
    public class EditManager_modifyInlineGraphic
    {
        static public function modifyInlineGraphic(sprite:Sprite):void
        {
            var textFlow:TextFlow = TextConverter.importToFlow( "How now brown cow.", TextConverter.PLAIN_TEXT_FORMAT );
            textFlow.flowComposer.addController( new ContainerController( sprite ));
            var editManager:EditManager = new EditManager( new UndoManager() );
            textFlow.interactionManager = editManager;
            textFlow.flowComposer.updateAllControllers();
            editManager.selectRange( 0, 0 );
            editManager.insertInlineGraphic( createGraphic(), 6, 6, "none" );
            
            editManager.selectRange( 0, 1 );
            editManager.modifyInlineGraphic( null, '12', '5', 'none' );
        }
    
        static private function createGraphic():Shape
        {
            var shape:Shape = new Shape();
            shape.graphics.beginFill( 0x993366 );
            shape.graphics.drawCircle( 4, 4, 6 );
            return shape;
        }
    }
}

moveChildren

()方法 
public function moveChildren(source:FlowGroupElement, sourceIndex:int, numChildren:int, destination:FlowGroupElement, destinationIndex:int, operationState:SelectionState = null):void

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

将一组 FlowElement 从一个 FlowGroupElement 移动至另一个 FlowGroupElement。目标属性必须是正在移动的子代的合法父代类型,否则会引发异常。

参数

source:FlowGroupElement — 要移动的元素的原始父代。
 
sourceIndex:int — 要移动的第一个元素的源中的子索引。
 
numChildren:int — 要移动的子元素数。
 
destination:FlowGroupElement — 移动后元素的新父代。
 
destinationIndex:int — 要将元素移动到的目标中的子索引。
 
operationState:SelectionState (default = null) — 指定该操作所应用的文本,以及指定撤消时选择内容返回到的文本。如果为 null,则操作应用于当前选择内容。如果没有当前选区,则该参数必须为非 null。

overwriteText

()方法 
public function overwriteText(text:String, operationState:SelectionState = null):void

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

覆盖所选文本。

如果进行了点选择,则新文本将覆盖第一个字符。

参数

text:String — 要插入的字符串。
 
operationState:SelectionState (default = null) — 指定该操作所作用的文本;如果为 null,该操作将应用于当前选择内容。


示例  ( 如何使用本示例 )

以下示例覆盖文本流中的文本字符串:
package flashx.textLayout.edit.examples
{
    import flash.display.Sprite;
    
    import flashx.textLayout.container.ContainerController;
    import flashx.textLayout.conversion.TextConverter;
    import flashx.textLayout.edit.EditManager;
    import flashx.textLayout.elements.TextFlow;
    import flashx.undo.UndoManager;
    
    public class EditManager_overwriteText
    {
        static public function overwriteText(sprite:Sprite):void
        {
            var textFlow:TextFlow = TextConverter.importToFlow( "How zzz brown cow.", TextConverter.PLAIN_TEXT_FORMAT );
            textFlow.flowComposer.addController( new ContainerController( sprite ));
            var editManager:EditManager = new EditManager( new UndoManager() );
            textFlow.interactionManager = editManager;
            textFlow.flowComposer.updateAllControllers();
            
            editManager.selectRange( 4, 6 );
            editManager.overwriteText( "now" ); //Displays: How now brown cow.
        }
    }
}

pasteTextScrap

()方法 
public function pasteTextScrap(scrapToPaste:flashx.textLayout.edit:TextScrap, operationState:SelectionState = null):void

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

将 TextScrap 粘贴到选定区域。

如果指定了文本范围,则会删除该范围内的文本。

参数

scrapToPaste:flashx.textLayout.edit:TextScrap — 要粘贴的 TextScrap。
 
operationState:SelectionState (default = null) — 指定该操作所作用的文本;如果为 null,该操作将应用于当前选择内容。

相关 API 元素

flashx.textLayout.edit.IEditManager.cutTextScrap
flashx.textLayout.edit.TextClipboard.getContents
flashx.textLayout.edit.TextScrap

示例  ( 如何使用本示例 )

以下示例剪切文本片段并将其粘贴到文本流中的其他位置:
package flashx.textLayout.edit.examples
{
    import flash.display.Sprite;
    
    import flashx.textLayout.container.ContainerController;
    import flashx.textLayout.conversion.TextConverter;
    import flashx.textLayout.edit.EditManager;
    import flashx.textLayout.edit.TextScrap;
    import flashx.textLayout.elements.TextFlow;
    import flashx.undo.UndoManager;
    
    public class EditManager_pasteTextScrap
    {
        static public function pasteText(sprite:Sprite):void
        {
            var textFlow:TextFlow = TextConverter.importToFlow( "How brown cow now.", TextConverter.PLAIN_TEXT_FORMAT );
            textFlow.flowComposer.addController( new ContainerController( sprite ));
            var editManager:EditManager = new EditManager( new UndoManager() );
            textFlow.interactionManager = editManager;
            textFlow.flowComposer.updateAllControllers();
            
            editManager.selectRange( 13, 17 );
            var scrap:TextScrap = editManager.cutTextScrap();
            
            editManager.selectRange( 3, 3 );
            editManager.pasteTextScrap( scrap ); //Displays: How now brown cow.
        }
    }
}

redo

()方法 
public function redo():void

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

执行上一个撤消的操作。

注意:如果与该 IEditManager 关联的 IUndoManager 也与其它 IEditManager 相关联,则有可能与后一个 IEditManager 关联的重做操作就是重做的操作。如果其它 IEditManager 的 FlowOperation 位于重做堆栈顶端,则可能发生这种情况。

如果未启用撤消功能,则该函数不执行任何操作。

相关 API 元素


示例  ( 如何使用本示例 )

以下示例定义一个函数,用于在文本流上重新执行上一个撤消操作:
package flashx.textLayout.edit.examples
{
    import flash.display.Sprite;
    
    import flashx.textLayout.edit.IEditManager;
    import flashx.textLayout.elements.TextFlow;
    
    public class EditManager_redo
    {
        static public function redo( textFlow:TextFlow ):void
        {
            if( textFlow.interactionManager is IEditManager )
            {
                IEditManager( textFlow.interactionManager ).redo();
            }
        }
    }
}

splitElement

()方法 
public function splitElement(target:FlowGroupElement, operationState:SelectionState = null):FlowGroupElement

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

在指定位置拆分目标元素,同时在当前元素后创建新元素。如果 operationState 是一个范围,则会删除范围中的文本。在 operationState 指定的文本位置后创建新元素。请注意,拆分 SubParagraphGroupElement 将会无效果,因为它们会自动与相邻元素重新合并。

您可能要使用的示例就是,如果您有一个列表,并且希望将其分为两个列表。

参数

target:FlowGroupElement — 要拆分的元素。
 
operationState:SelectionState (default = null) — 指定该操作所作用的文本;如果为 null,该操作将应用于当前选择内容。

返回
FlowGroupElement — 已创建的新段落。

splitParagraph

()方法 
public function splitParagraph(operationState:SelectionState = null):ParagraphElement

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

在当前位置拆分段落,同时在当前段落后创建新段落。

如果指定了文本范围,则会删除该范围内的文本。

参数

operationState:SelectionState (default = null) — 指定该操作所作用的文本;如果为 null,该操作将应用于当前选择内容。

返回
ParagraphElement — 已创建的新段落。

示例  ( 如何使用本示例 )

以下示例将一个段落拆分为两个:
package flashx.textLayout.edit.examples
{
    import flash.display.Sprite;
    
    import flashx.textLayout.container.ContainerController;
    import flashx.textLayout.conversion.TextConverter;
    import flashx.textLayout.edit.EditManager;
    import flashx.textLayout.edit.TextScrap;
    import flashx.textLayout.elements.TextFlow;
    import flashx.undo.UndoManager;
    
    public class EditManager_splitParagraph
    {
        static public function splitParagraph(sprite:Sprite):void
        {
            var textFlow:TextFlow = TextConverter.importToFlow( "How now brown cow.", TextConverter.PLAIN_TEXT_FORMAT );
            textFlow.flowComposer.addController( new ContainerController( sprite ));
            var editManager:EditManager = new EditManager( new UndoManager() );
            textFlow.interactionManager = editManager;
            textFlow.flowComposer.updateAllControllers();
            
            editManager.selectRange( 8, 8 );
            editManager.splitParagraph();    //Displays:     How now
                                            //                brown cow.
        }
    }
}

undo

()方法 
public function undo():void

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

恢复上一个操作。

注意:如果与该 IEditManager 关联的 IUndoManager 也与其它 IEditManager 相关联,则有可能与后一个 IEditManager 关联的撤消操作就是撤消的操作。如果其它 IEditManager 的 FlowOperation 位于撤消堆栈顶端,则可能会发生这种情况。

如果未启用撤消功能,则该函数不执行任何操作。

相关 API 元素


示例  ( 如何使用本示例 )

下例定义了一个用于撤消文本流上的最后一个操作的函数。
package flashx.textLayout.edit.examples
{
    import flashx.textLayout.edit.IEditManager;
    import flashx.textLayout.elements.TextFlow;
    
    public class EditManager_undo
    {
        static public function undo( textFlow:TextFlow ):void
        {
            if( textFlow.interactionManager is IEditManager )
            {
                IEditManager( textFlow.interactionManager ).undo();
            }
        }
    }
}

updateAllControllers

()方法 
public function updateAllControllers():void

语言版本: ActionScript 3.0
运行时版本: Flash Player 10.2, AIR 2.0

在操作对其进行修改后显示。通常是自动处理,但 delayUpdates 打开时会调用此方法,且在下一个 enter_frame 事件前必须更新显示。





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

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