ActionScript® 3.0 Reference for the Adobe® Flash® Platform
Home  |  Hide Packages and Classes List |  Packages  |  Classes  |  What's New  |  Index  |  Appendixes

Language Reference only
Filters: AIR 32.0 and earlier, Flash Player 32.0 and earlier, Flash Lite 4
Flex 4.6 and earlier, Flash Pro CS6 and earlier
Hide Filters
flashx.textLayout.edit 

EditManager  - AS3

Packagesx

Top Level
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

Language Elements

Global Constants
Global Functions
Operators
Statements, Keywords & Directives
Special Types

Appendixes

What's New
Compiler Errors
Compiler Warnings
Run-Time Errors
Migrating to ActionScript 3
Supported Character Sets
MXML Only Tags
Motion XML Elements
Timed Text Tags
List of deprecated elements
Accessibility Implementation Constants
How to Use ActionScript Examples
Legal notices
Packageflashx.textLayout.edit
Classpublic class EditManager
InheritanceEditManager Inheritance SelectionManager Inheritance Object
Implements IEditManager

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

The EditManager class manages editing changes to a TextFlow.

To enable text flow editing, assign an EditManager object to the interactionManager property of the TextFlow object. The edit manager handles changes to the text (such as insertions, deletions, and format changes). Changes are reversible if the edit manager has an undo manager. The edit manager triggers the recomposition and display of the text flow, as necessary.

The EditManager class supports the following keyboard shortcuts:

KeysResult
ctrl-zundo
ctrl-yredo
ctrl-backspacedeletePreviousWord
ctrl-deletedeleteNextWord
alt+deletedeleteNextWord
ctrl+alt-deletedeleteNextWord
ctrl-shift-hypheninsert discretionary hyphen
ctrl+backspacedeletePreviousWord
alt+backspacedeletePreviousWord
ctrl+alt-backspacedeletePreviousWord
INSERTtoggles overWriteMode
backspacedeletePreviousCharacter
ENTERif textFlow.configuration.manageEnterKey in a list it creates a new list item, otherwise creates a new paragraph
shift-ENTERif textFlow.configuration.manageEnterKey creates a new paragraph
TABif textFlow.configuration.manageTabKey in a list it creates nested list, otherwise inserts a TAB or overwrites next character with a TAB
shift-TABif textFlow.configuration.manageTabKey in the first item of a list it moves the item out of the list (promotes it)

Note: The following keys do not work on Windows: alt-backspace, alt-delete, ctrl+alt-backspace, and ctrl+alt-delete. These keys do not generate an event for the runtime.

View the examples

Related API Elements



Public Properties
 PropertyDefined By
 InheritedabsoluteEnd : int
[read-only] The text position of the end of the selection, as an offset from the start of the text flow.
SelectionManager
 InheritedabsoluteStart : int
[read-only] The text position of the start of the selection, as an offset from the start of the text flow.
SelectionManager
 InheritedactivePosition : int
[read-only] The active point of the selection.
SelectionManager
  allowDelayedOperations : Boolean
EditManager
 InheritedanchorPosition : int
[read-only] The anchor point of the selection.
SelectionManager
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
 InheritedcurrentSelectionFormat : SelectionFormat
[read-only] The current SelectionFormat object.
SelectionManager
  delayUpdates : Boolean
EditManager
 InheritededitingMode : String
[read-only] The editing mode.
SelectionManager
 Inheritedfocused : Boolean
[read-only] Indicates whether a container in the text flow has the focus.
SelectionManager
 InheritedfocusedSelectionFormat : SelectionFormat
The SelectionFormat object used to draw the selection in a focused container.
SelectionManager
 InheritedinactiveSelectionFormat : SelectionFormat
The SelectionFormat object used to draw the selection when it is not in the active window.
SelectionManager
  overwriteMode : Boolean = false
[static] Indicates whether overwrite mode is on or off.
EditManager
 InheritedtextFlow : flashx.textLayout.elements:TextFlow
The TextFlow object managed by this selection manager.
SelectionManager
  undoManager : IUndoManager
[read-only] The IUndoManager assigned to this edit manager.
EditManager
 InheritedunfocusedSelectionFormat : SelectionFormat
The SelectionFormat object used to draw the selection when it is not in a focused container, but is in the active window.
SelectionManager
 InheritedwindowActive : Boolean
[read-only] Indicates whether the window associated with the text flow is active.
SelectionManager
Protected Properties
 PropertyDefined By
 InheritedpointFormat : flashx.textLayout.formats:ITextLayoutFormat
[read-only] The format that will be applied to inserted text.
SelectionManager
Public Methods
 MethodDefined By
  
EditManager(undoManager:IUndoManager = null)
Creates an EditManager object.
EditManager
 Inherited
Processes an activate event.
SelectionManager
  
Applies container styles to any containers in the selection.
EditManager
  
Changes the formats of the specified (or current) selection.
EditManager
  
applyFormatToElement(targetElement:FlowElement, format:flashx.textLayout.formats:ITextLayoutFormat, relativeStart:int = 0, relativeEnd:int = -1, operationState:SelectionState = null):void
Applies styles to the specified element.
EditManager
  
Changes the format applied to the leaf elements in the specified (or current) selection.
EditManager
  
applyLink(href:String, targetString:String = null, extendToLinkBoundary:Boolean = false, operationState:SelectionState = null):LinkElement
Transforms a selection into a link, or a link into normal text.
EditManager
  
Applies paragraph styles to any paragraphs in the selection.
EditManager
  
Transforms text into a TCY run, or a TCY run into non-TCY text.
EditManager
  
Begins a new group of operations.
EditManager
  
changeElementID(newID:String, targetElement:FlowElement, relativeStart:int = 0, relativeEnd:int = -1, operationState:SelectionState = null):void
Changes the ID of an element.
EditManager
  
changeStyleName(newName:String, targetElement:FlowElement, relativeStart:int = 0, relativeEnd:int = -1, operationState:SelectionState = null):void
Deprecated since 2.0: Please Use applyFormatToElement
Changes the styleName of an element or part of an element.
EditManager
  
changeTypeName(newName:String, targetElement:FlowElement, relativeStart:int = 0, relativeEnd:int = -1, operationState:SelectionState = null):void
Changes the typeName of an element or part of an element.
EditManager
  
Undefines formats of the specified (or current) selection.
EditManager
  
Undefines styles to the specified element.
EditManager
  
Creates a new DivElement that contains the entire range specified in the operationState at the lowest common parent element that contains both the start and end points of the range.
EditManager
  
Creates a new ListElement that contains the entire range specified in the operationState at the lowest common parent element that contains both the start and end points of the range.
EditManager
  
Creates a new SubParagraphGroupElement that contains the entire range specified in the operationState at the lowest common parent element that contains both the start and end points of the range.
EditManager
  
Deletes the selected area and returns the deleted area in a TextScrap object.
EditManager
 Inherited
Processes a deactivate event.
SelectionManager
  
deleteNextCharacter(operationState:SelectionState = null):void
Deletes a range of text, or, if a point selection is given, deletes the next character.
EditManager
  
deleteNextWord(operationState:SelectionState = null):void
Deletes the next word.
EditManager
  
Deletes a range of text, or, if a point selection is given, deletes the previous character.
EditManager
  
deletePreviousWord(operationState:SelectionState = null):void
Deletes the previous word.
EditManager
  
deleteText(operationState:SelectionState = null):void
Deletes a range of text.
EditManager
  
[override] Executes a FlowOperation.
EditManager
 Inherited
Processes an edit event.
SelectionManager
  
Ends a group of operations.
EditManager
 Inherited
SelectionManager
 Inherited
Processes a focusChange event.
SelectionManager
 Inherited
Processes a focusIn event.
SelectionManager
 Inherited
Processes a focusOut event.
SelectionManager
 Inherited
Gets the character format attributes that are common to all characters in the specified text range or current selection.
SelectionManager
 Inherited
Gets the container format attributes that are common to all containers in the specified text range or current selection.
SelectionManager
 Inherited
Gets the paragraph format attributes that are common to all paragraphs in the specified text range or current selection.
SelectionManager
 Inherited
Gets the SelectionState object of the current selection.
SelectionManager
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether there is a selection.
SelectionManager
 Inherited
Processes an imeStartComposition event
SelectionManager
  
insertInlineGraphic(source:Object, width:Object, height:Object, options:Object = null, operationState:SelectionState = null):InlineGraphicElement
Inserts an image.
EditManager
  
insertText(text:String, origOperationState:SelectionState = null):void
Inserts text.
EditManager
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the selection covers a range of text.
SelectionManager
 Inherited
Processes a keyDown event.
SelectionManager
 Inherited
Processes a keyFocusChange event.
SelectionManager
 Inherited
Processes a keyUp event.
SelectionManager
 Inherited
Processes a menuSelect event.
SelectionManager
  
modifyInlineGraphic(source:Object, width:Object, height:Object, options:Object = null, operationState:SelectionState = null):void
Modifies an existing inline graphic.
EditManager
 Inherited
Processes a mouseDoubleClick event.
SelectionManager
 Inherited
Processes a mouseDown event.
SelectionManager
 Inherited
Processes a mouseMove event.
SelectionManager
 Inherited
Processes a mouseOut event.
SelectionManager
 Inherited
Processes a mouseOver event.
SelectionManager
 Inherited
Processes a mouseUp event.
SelectionManager
 Inherited
Processes a mouseWheel event.
SelectionManager
  
moveChildren(source:FlowGroupElement, sourceIndex:int, numChildren:int, destination:FlowGroupElement, destinationIndex:int, selectionState:SelectionState = null):void
Move a set of FlowElements from one FlowGroupElement to another.
EditManager
 Inherited
notifyInsertOrDelete(absolutePosition:int, length:int):void
Updates the selection manager when text is inserted or deleted.
SelectionManager
  
overwriteText(text:String, operationState:SelectionState = null):void
Overwrites the selected text.
EditManager
  
Pastes the TextScrap into the selected area.
EditManager
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
  
Reperforms the previous undone operation.
EditManager
 Inherited
Redisplays the selection shapes.
SelectionManager
 Inherited
SelectionManager
 Inherited
selectRange(anchorPosition:int, activePosition:int):void
SelectionManager
 Inherited
Gives the focus to the first container in the selection.
SelectionManager
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Sets the SelectionState object of the current selection.
SelectionManager
 Inherited
Processes an softKeyboardActivating event
SelectionManager
  
Splits the target element at the location specified, creating a new element after the current one.
EditManager
  
Splits the paragraph at the current position, creating a new paragraph after the current one.
EditManager
 Inherited
Processes a TextEvent.
SelectionManager
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
  
Reverses the previous operation.
EditManager
  
EditManager
 Inherited
Returns the primitive value of the specified object.
Object
Property Detail

allowDelayedOperations

property
allowDelayedOperations:Boolean



Implementation
    public function get allowDelayedOperations():Boolean
    public function set allowDelayedOperations(value:Boolean):void

delayUpdates

property 
delayUpdates:Boolean



Implementation
    public function get delayUpdates():Boolean
    public function set delayUpdates(value:Boolean):void

overwriteMode

property 
public static var overwriteMode:Boolean = false

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

Indicates whether overwrite mode is on or off.

If true, then a keystroke overwrites the character following the cursor. If false, then a keystroke is inserted at the cursor location.

undoManager

property 
undoManager:IUndoManager  [read-only]

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

The IUndoManager assigned to this edit manager.

To allow edits to be undone (and redone), pass an IUndoManager instance to the EditManager constructor. The undo manager maintains a stack of operations that have been executed, and it can undo or redo individual operations.

Note: If the TextFlow is modified directly (not via calls to the EditManager, but directly via calls to the managed FlowElement objects), then the EditManager clears the undo stack to prevent the stack from getting out of sync with the current state.



Implementation
    public function get undoManager():IUndoManager
Constructor Detail

EditManager

()Constructor
public function EditManager(undoManager:IUndoManager = null)

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

Creates an EditManager object.

Assign an EditManager object to the interactionManager property of a text flow to enable editing of that text flow.

To enable support for undoing and redoing changes, pass an IUndoManager instance to the EditManager constructor. You can use the flashx.undo.UndoManager class or create a custom IUndoManager instance. Use a custom IUndoManager instance to integrate Text Layout Framework changes with an existing undo manager that is not an instance of the UndoManager class. To create a custom IUndoManager instance, ensure that the class you use to define the undo manager implements the IUndoManager interface.

Parameters
undoManager:IUndoManager (default = null) — The UndoManager for the application

Related API Elements


Example  ( How to use this example )

The following example creates an EditManager object for a text flow:
package flashx.textLayout.edit.examples
{
    import flashx.textLayout.edit.EditManager;
    import flashx.textLayout.elements.TextFlow;
    import flashx.undo.UndoManager;
    
    public class EditManager_constructor
    {
        // Create a new TextFlow that is editable and undoable.
        static public function createEditableTextFlow():TextFlow
        {
             var textFlow:TextFlow = new TextFlow();
             textFlow.interactionManager = new EditManager( new UndoManager() );
             return textFlow;
        }
    }
}

Method Detail

applyContainerFormat

()method
public function applyContainerFormat(containerFormat:flashx.textLayout.formats:ITextLayoutFormat, operationState:SelectionState = null):void

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

Applies container styles to any containers in the selection.

Any style properties in the format object that are null are left unchanged.

Parameters

containerFormat:flashx.textLayout.formats:ITextLayoutFormat — The format to apply to the containers in the range
 
operationState:SelectionState (default = null) — Specifies the text to which this operation applies; if null, the operation applies to the current selection.


Example  ( How to use this example )

The following example changes the format of the containers holding a selection to display two columns:
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

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

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

Changes the formats of the specified (or current) selection.

Executes an undoable operation that applies the new formats. Only style attributes set for the TextLayoutFormat objects are applied. Undefined attributes in the format objects are not changed.

Parameters

leafFormat:flashx.textLayout.formats:ITextLayoutFormat — The format to apply to leaf elements such as spans and inline graphics.
 
paragraphFormat:flashx.textLayout.formats:ITextLayoutFormat — The format to apply to paragraph elements.
 
containerFormat:flashx.textLayout.formats:ITextLayoutFormat — The format to apply to the containers.
 
operationState:SelectionState (default = null) — Specifies the text to which this operation applies; if null, the operation applies to the current selection.


Example  ( How to use this example )

The following example applies a container, paragraph, and a character format to a selection.
 
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

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

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

Applies styles to the specified element.

Any style properties in the format object that are null are left unchanged. Only styles that are relevant to the specified element are applied.

Parameters

targetElement:FlowElement — The element to which the styles are applied.
 
format:flashx.textLayout.formats:ITextLayoutFormat — The format containing the styles to apply.
 
relativeStart:int (default = 0) — An offset from the beginning of the element at which to split the element when assigning the new formatting.
 
relativeEnd:int (default = -1) — An offset from the beginning of the element at which to split the element when applying the new formatting.
 
operationState:SelectionState (default = null) — Specifies the text to which this operation applies; if null, the operation applies to the current selection.

applyLeafFormat

()method 
public function applyLeafFormat(characterFormat:flashx.textLayout.formats:ITextLayoutFormat, operationState:SelectionState = null):void

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

Changes the format applied to the leaf elements in the specified (or current) selection.

Executes an undoable operation that applies the new format to leaf elements such as SpanElement and InlineGraphicElement objects. Only style attributes set for the TextLayoutFormat objects are applied. Undefined attributes in the format object are changed.

Parameters

characterFormat:flashx.textLayout.formats:ITextLayoutFormat — The format to apply.
 
operationState:SelectionState (default = null) — Specifies the text to which this operation applies; if null, the operation applies to the current selection.


Example  ( How to use this example )

The following example changes the color of text in a selection to red.
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

()method 
public function applyLink(href:String, targetString:String = null, extendToLinkBoundary:Boolean = false, operationState:SelectionState = null):LinkElement

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

Transforms a selection into a link, or a link into normal text.

Executes an undoable operation that creates or removes the link.

If a target parameter is specified, it must be one of the following values:

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

In browser-hosted runtimes, a target of "_self" replaces the current html page. So, if the SWF content containing the link is in a page within a frame or frameset, the linked content loads within that frame. If the page is at the top level, the linked content opens to replace the original page. A target of "_blank" opens a new browser window with no name. A target of "_parent" replaces the parent of the html page containing the SWF content. A target of "_top" replaces the top-level page in the current browser window.

In other runtimes, such as Adobe AIR, the link opens in the user's default browser and the target parameter is ignored.

The extendToLinkBoundary parameter determines how the edit manager treats a selection that intersects with one or more existing links. If the parameter is true, then the operation is applied as a unit to the selection and the whole text of the existing links. Thus, a single link is created that spans from the beginning of the first link intersected to the end of the last link intersected. In contrast, if extendToLinkBoundary were false in this situation, the existing partially selected links would be split into two links.

Parameters

href:String — The uri referenced by the link.
 
targetString:String (default = null) — The target browser window of the link.
 
extendToLinkBoundary:Boolean (default = false) — Specifies whether to consolidate selection with any overlapping existing links, and then apply the change.
 
operationState:SelectionState (default = null) — Specifies the text to which this operation applies; if null, the operation applies to the current selection.

Returns
LinkElement — The LinkElement that was created.

Example  ( How to use this example )

The following example defines two functions. The first transforms a selection into a link. The second removes the URL from a link.
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

()method 
public function applyParagraphFormat(paragraphFormat:flashx.textLayout.formats:ITextLayoutFormat, operationState:SelectionState = null):void

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

Applies paragraph styles to any paragraphs in the selection.

Any style properties in the format object that are null are left unchanged.

Parameters

paragraphFormat:flashx.textLayout.formats:ITextLayoutFormat — The format to apply to the selected paragraphs.
 
operationState:SelectionState (default = null) — Specifies the text to which this operation applies; if null, the operation applies to the current selection.


Example  ( How to use this example )

The following example defines a function to change the format of any paragraphs included in a current selection to justify the text.
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

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

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

Transforms text into a TCY run, or a TCY run into non-TCY text.

TCY, or tate-chu-yoko, causes text to draw horizontally within a vertical line, and is used to make small blocks of non-Japanese text or numbers, such as dates, more readable in vertical text.

Parameters

tcyOn:Boolean — Set to true to apply TCY to a text range, false to remove TCY.
 
operationState:SelectionState (default = null) — Specifies the text to which this operation applies; if null, the operation applies to the current selection.

Returns
flashx.textLayout.elements:TCYElement — The TCYElement that was created.

Example  ( How to use this example )

The following example defines two functions. The first applies TCY formatting to the current selection. The second removes TCY formatting.
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

()method 
public function beginCompositeOperation():void

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

Begins a new group of operations.

All operations executed after the call to beginCompositeOperation(), and before the matching call to endCompositeOperation() are executed and grouped together as a single operation that can be undone as a unit.

A beginCompositeOperation/endCompositeOperation block can be nested inside another beginCompositeOperation/endCompositeOperation block.


Example  ( How to use this example )

The following example defines a function that inserts a graphic object in its own paragraph. If the beginCompositeOperation() and endCompositeOperation() functions were not used, then each of the suboperations would have to be undone separately rather than as a group.
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

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

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

Changes the ID of an element.

If the relativeStart or relativeEnd parameters are set (to anything other than the default values), then the element is split. The parts of the element outside this range retain the original ID. Setting both the relativeStart and relativeEnd parameters creates elements with duplicate IDs.

Parameters

newID:String — The new ID value.
 
targetElement:FlowElement — The element to modify.
 
relativeStart:int (default = 0) — An offset from the beginning of the element at which to split the element when assigning the new ID.
 
relativeEnd:int (default = -1) — An offset from the beginning of the element at which to split the element when assigning the new ID.
 
operationState:SelectionState (default = null) — Specifies the selection to restore when undoing this operation; if null, the operation saves the current selection.


Example  ( How to use this example )

The following example defines a function that changes the ID of the first paragraph in a selection:
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

()method 
public function changeStyleName(newName:String, targetElement:FlowElement, relativeStart:int = 0, relativeEnd:int = -1, operationState:SelectionState = null):void
Deprecated since 2.0: Please Use applyFormatToElement

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

Changes the styleName of an element or part of an element.

If the relativeStart or relativeEnd parameters are set (to anything other than the default values), then the element is split. The parts of the element outside this range retain the original style.

Parameters

newName:String — The name of the new style.
 
targetElement:FlowElement — Specifies the element to change.
 
relativeStart:int (default = 0) — An offset from the beginning of the element at which to split the element when assigning the new style.
 
relativeEnd:int (default = -1) — An offset from the end of the element at which to split the element when assigning the new style.
 
operationState:SelectionState (default = null) — Specifies the selection to restore when undoing this operation; if null, the operation saves the current selection.


Example  ( How to use this example )

The following example defines a functions that changes the style name of the first paragraph in a selection:
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

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

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

Changes the typeName of an element or part of an element.

If the relativeStart or relativeEnd parameters are set (to anything other than the default values), then the element is split. The parts of the element outside this range retain the original style.

Parameters

newName:String — The name of the new type.
 
targetElement:FlowElement — Specifies the element to change.
 
relativeStart:int (default = 0) — An offset from the beginning of the element at which to split the element when assigning the new style
 
relativeEnd:int (default = -1) — An offset from the end of the element at which to split the element when assigning the new style
 
operationState:SelectionState (default = null) — Specifies the selection to restore when undoing this operation; if null, the operation saves the current selection.

clearFormat

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

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

Undefines formats of the specified (or current) selection.

Executes an undoable operation that undefines the specified formats. Only style attributes set for the TextLayoutFormat objects are applied. Undefined attributes in the format objects are not changed.

Parameters

leafFormat:flashx.textLayout.formats:ITextLayoutFormat — The format whose set values indicate properties to undefine to LeafFlowElement objects in the selected range.
 
paragraphFormat:flashx.textLayout.formats:ITextLayoutFormat — The format whose set values indicate properties to undefine to ParagraphElement objects in the selected range.
 
containerFormat:flashx.textLayout.formats:ITextLayoutFormat — The format whose set values indicate properties to undefine to ContainerController objects in the selected range.
 
operationState:SelectionState (default = null) — Specifies the text to which this operation applies; if null, the operation applies to the current selection.

clearFormatOnElement

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

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

Undefines styles to the specified element.

Any style properties in the format object that are undefined are left unchanged. Any styles that are defined in the specififed format are undefined on the specified element.

Parameters

targetElement:FlowElement — The element to which the styles are applied.
 
format:flashx.textLayout.formats:ITextLayoutFormat — The format containing the styles to undefine.
 
operationState:SelectionState (default = null) — Specifies the text to which this operation applies; if null, the operation applies to the current selection.

createDiv

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

Creates a new DivElement that contains the entire range specified in the operationState at the lowest common parent element that contains both the start and end points of the range. If the start and end points are the same, a new DivElement is created at that position with a single child paragraph.

Parameters

parent:FlowGroupElement (default = null) — Specifies a parent element for the new DivElement. If null the new parent will be lowest level that contains the SelectionState.
 
format:flashx.textLayout.formats:ITextLayoutFormat (default = null) — Formatting attributes to apply to the new DivElement.
 
operationState:SelectionState (default = null) — Specifies the text to which this operation applies; if null, the operation applies to the current selection.

Returns
DivElement — The new DivElement that was created.

createList

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

Creates a new ListElement that contains the entire range specified in the operationState at the lowest common parent element that contains both the start and end points of the range. Each paragraph within the range will become a ListItemElement in the new ListElement. If the start and end points are the same, a new ListElement is created at that position with a single ListItemElement child.

Parameters

parent:FlowGroupElement (default = null) — Optionally specifies a parent element for the new ListElement. If null the new parent will be lowest level that contains the SelectionState.
 
format:flashx.textLayout.formats:ITextLayoutFormat (default = null) — Formatting attributes to apply to the new ListElement.
 
operationState:SelectionState (default = null) — Specifies the text to which this operation applies; if null, the operation applies to the current selection.

Returns
ListElement — The new ListElement that was created.

createSubParagraphGroup

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

Creates a new SubParagraphGroupElement that contains the entire range specified in the operationState at the lowest common parent element that contains both the start and end points of the range. If the start and end points are the same, nothing is done.

Parameters

parent:FlowGroupElement (default = null) — Specifies a parent element for the new SubParagraphGroupElement element. If null the new parent will be lowest level that contains the SelectionState.
 
format:flashx.textLayout.formats:ITextLayoutFormat (default = null) — Formatting attributes to apply to the new SubParagraphGroupElement
 
operationState:SelectionState (default = null) — Specifies the text to which this operation applies; if null, the operation applies to the current selection.

Returns
SubParagraphGroupElement — The new SubParagraphGroupElement that was created.

cutTextScrap

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

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

Deletes the selected area and returns the deleted area in a TextScrap object.

The resulting TextScrap can be posted to the system clipboard or used in a subsequent pasteTextOperation() operation.

Parameters

operationState:SelectionState (default = null) — Specifies the text to which this operation applies; if null, the operation applies to the current selection.

Returns
flashx.textLayout.edit:TextScrap — The TextScrap that was cut.

Related API Elements


Example  ( How to use this example )

The following example creates a selection in a text flow cuts the selected range and creates a TextScrap object containing the deleted content.
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

()method 
public function deleteNextCharacter(operationState:SelectionState = null):void

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

Deletes a range of text, or, if a point selection is given, deletes the next character.

Parameters

operationState:SelectionState (default = null) — specifies the text to which this operation applies; if null, the operation applies to the current selection.


Example  ( How to use this example )

The following example creates a point selection in a text flow and deletes the next character.
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

()method 
public function deleteNextWord(operationState:SelectionState = null):void

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

Deletes the next word.

If a range is selected, the first word of the range is deleted.

Parameters

operationState:SelectionState (default = null) — Specifies the text to which this operation applies; if null, the operation applies to the current selection.


Example  ( How to use this example )

The following example creates a point selection in a text flow and deletes the next word.
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

()method 
public function deletePreviousCharacter(operationState:SelectionState = null):void

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

Deletes a range of text, or, if a point selection is given, deletes the previous character.

Parameters

operationState:SelectionState (default = null) — Specifies the text to which this operation applies; if null, the operation applies to the current selection.


Example  ( How to use this example )

The following example creates a point selection in a text flow and deletes the previous character.
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

()method 
public function deletePreviousWord(operationState:SelectionState = null):void

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

Deletes the previous word.

If a range is selected, the first word of the range is deleted.

Parameters

operationState:SelectionState (default = null) — Specifies the text to which this operation applies; if null, the operation applies to the current selection.


Example  ( How to use this example )

The following example creates a point selection in a text flow and deletes the previous word.
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

()method 
public function deleteText(operationState:SelectionState = null):void

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

Deletes a range of text.

Parameters

operationState:SelectionState (default = null) — Specifies the text to which this operation applies; if null, the operation applies to the current selection.


Example  ( How to use this example )

The following example creates a range selection in a text flow and deletes the selected characters.
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

()method 
override public function doOperation(operation:FlowOperation):void

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

Executes a FlowOperation.

The doOperation() method is called by IEditManager functions that update the text flow. You do not typically need to call this function directly unless you create your own custom operations.

This function proceeds in the following steps:

  1. Flush any pending operations before performing this operation.
  2. Send a cancelable flowOperationBegin event. If canceled this method returns immediately.
  3. Execute the operation. The operation returns true or false. False indicates that no changes were made.
  4. Push the operation onto the undo stack.
  5. Clear the redo stack.
  6. Update the display.
  7. Send a cancelable flowOperationEnd event.

Exception handling: If the operation throws an exception, it is caught and the error is attached to the flowOperationEnd event. If the event is not canceled the error is rethrown.

Parameters

operation:FlowOperation — a FlowOperation object


Example  ( How to use this example )

The following example creates and executes an 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

()method 
public function endCompositeOperation():void

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

Ends a group of operations.

All operations executed since the last call to beginCompositeOperation() are grouped as a CompositeOperation that is then completed. This CompositeOperation object is added to the undo stack or, if this composite operation is nested inside another composite operation, added to the parent operation.


Example  ( How to use this example )

The following example defines a function that inserts a graphic object in its own paragraph. If the beginCompositeOperation() and endCompositeOperation() functions were not used, then each of the suboperations would have to be undone separately rather than as a group.
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();                
        }
    }
}

insertInlineGraphic

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

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

Inserts an image.

The source of the image can be a string containing a URI, URLRequest object, a Class object representing an embedded asset, or a DisplayObject instance.

The width and height values can be the number of pixels, a percent, or the string, 'auto', in which case the actual dimension of the graphic is used.

Set the float to one of the constants defined in the Float class to specify whether the image should be displayed to the left or right of any text or inline with the text.

Parameters

source:Object — Can be either a String interpreted as a uri, a Class interpreted as the class of an Embed DisplayObject, a DisplayObject instance or a URLRequest.
 
width:Object — The width of the image to insert (number, percent, or 'auto').
 
height:Object — The height of the image to insert (number, percent, or 'auto').
 
options:Object (default = null) — None supported.
 
operationState:SelectionState (default = null) — Specifies the text to which this operation applies; if null, the operation applies to the current selection.

Returns
InlineGraphicElement

Related API Elements


Example  ( How to use this example )

The following example inserts a Shape object at the beginning of a text flow:
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

()method 
public function insertText(text:String, origOperationState:SelectionState = null):void

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

Inserts text.

Inserts the text at a position or range in the text. If the location supplied in the operationState parameter is a range (or the parameter is null and the current selection is a range), then the text currently in the range is replaced by the inserted text.

Parameters

text:String — The string to insert.
 
origOperationState:SelectionState (default = null) — Specifies the text in the flow to which this operation applies; if null, the operation applies to the current selection.


Example  ( How to use this example )

The following example creates and executes an 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

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

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

Modifies an existing inline graphic.

Set unchanging properties to the values in the original graphic. (Modifying an existing graphic object is typically more efficient than deleting and recreating one.)

Parameters

source:Object — Can be either a String interpreted as a uri, a Class interpreted as the class of an Embed DisplayObject, a DisplayObject instance or a URLRequest.
 
width:Object — The new width for the image (number or percent).
 
height:Object — The new height for the image (number or percent).
 
options:Object (default = null) — None supported.
 
operationState:SelectionState (default = null) — Specifies the text to which this operation applies; if null, the operation applies to the current selection.


Example  ( How to use this example )

The following example inserts a circle at the beginning of a text flow, and then changes the width and height properties of the inline graphic to stretch it into an ellipse:
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

()method 
public function moveChildren(source:FlowGroupElement, sourceIndex:int, numChildren:int, destination:FlowGroupElement, destinationIndex:int, selectionState:SelectionState = null):void

Move a set of FlowElements from one FlowGroupElement to another. The desinationElement must be a legal parent type for the children being moved, or an exception is thrown.

Parameters

source:FlowGroupElement — The orginal parent of the elements to be moved.
 
sourceIndex:int — The child index within the source of the first element to be moved.
 
numChildren:int — The number of children being moved.
 
destination:FlowGroupElement — The new parent of elements after move.
 
destinationIndex:int — The child index within the destination to where elements are moved to.
 
selectionState:SelectionState (default = null) — Specifies the text to which this operation applies, and to which selection returns to upon undo. If null, the operation applies to the current selection. If there is no current selection, this parameter must be non-null.

overwriteText

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

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

Overwrites the selected text.

If the selection is a point selection, the first character is overwritten by the new text.

Parameters

text:String — The string to insert.
 
operationState:SelectionState (default = null) — Specifies the text to which this operation applies; if null, the operation applies to the current selection.


Example  ( How to use this example )

The following example overwrites a string of text in a text flow:
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

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

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

Pastes the TextScrap into the selected area.

If a range of text is specified, the text in the range is deleted.

Parameters

scrapToPaste:flashx.textLayout.edit:TextScrap — The TextScrap to paste.
 
operationState:SelectionState (default = null) — Specifies the text to which this operation applies; if null, the operation applies to the current selection.

Related API Elements


Example  ( How to use this example )

The following example cuts a text scrap and pastes it into a different location in a text flow:
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

()method 
public function redo():void

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

Reperforms the previous undone operation.

Note: If the IUndoManager associated with this IEditManager is also associated with another IEditManager, then it is possible that the redo operation associated with the other IEditManager is the one redone. This can happen if the FlowOperation of another IEditManager is on top of the redo stack.

This function does nothing if undo is not turned on.

Related API Elements


Example  ( How to use this example )

The following example defines a function that reperforms the last undone operation on a text flow:
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

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

Splits the target element at the location specified, creating a new element after the current one. If the operationState is a range, the text within the range is deleted. The new element is created after the text position specified by operationState. Note that splitting a SubParagraphGroupElement will have no effect because they will automatically remerge with the adejacent elements.

An example where you might want to use this is if you have a list, and you want to divide it into two lists.

Parameters

target:FlowGroupElement — The element to be split.
 
operationState:SelectionState (default = null) — Specifies the text to which this operation applies; if null, the operation applies to the current selection.

Returns
FlowGroupElement — The new paragraph that was created.

splitParagraph

()method 
public function splitParagraph(operationState:SelectionState = null):ParagraphElement

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

Splits the paragraph at the current position, creating a new paragraph after the current one.

If a range of text is specified, the text in the range is deleted.

Parameters

operationState:SelectionState (default = null) — Specifies the text to which this operation applies; if null, the operation applies to the current selection.

Returns
ParagraphElement — The new paragraph that was created.

Example  ( How to use this example )

The following example splits a paragraph into two:
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

()method 
public function undo():void

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

Reverses the previous operation.

Note: If the IUndoManager associated with this IEditManager is also associated with another IEditManager, then it is possible that the undo operation associated with the other IEditManager is the one undone. This can happen if the FlowOperation of another IEditManager is on top of the undo stack.

This function does nothing if undo is not turned on.

Related API Elements


Example  ( How to use this example )

The following example defines a function that undoes the last operation on a text flow:
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

()method 
public function updateAllControllers():void

EditManager_example.as

The following example uses the EditManager class to make a line of text editable:
  1. Create a TextFlow (tf) to contain a line of sample text.
  2. Store the text in a SpanElement that is in turn stored in a ParagraphElement.
  3. Create a ContainerController for the text and compose the text for display.
  4. Instantiate the TextFlow manager objects for later use by an event listener.
  5. Create a very simple edit button that allows a user to make the text editable.
  6. Create the button's event listener that toggles between read only and editable states.

The value of the TextFlow's interactionManager property determines whether the sample text is editable. If the property is null, the sample text is read only. If the property is assigned an EditManager instance, the sample text is editable. The createEditButton() method creates a very simple button-like TextField instance. When a user clicks on the TextField instance, the updateEditable() listener function toggles the value of the interactionManager property.

package flashx.textLayout.edit.examples {
    import flash.display.Sprite;
    import flash.events.MouseEvent;
    import flash.text.TextField;
    import flash.text.TextFieldAutoSize;
    
    import flashx.textLayout.container.ContainerController;
    import flashx.textLayout.edit.EditManager;
    import flashx.textLayout.elements.ParagraphElement;
    import flashx.textLayout.elements.SpanElement;
    import flashx.textLayout.elements.TextFlow;
    import flashx.undo.UndoManager;
    
    public class EditManager_example extends Sprite
    {
        private var tf:TextFlow;
        private var em:EditManager;
        private var um:UndoManager;
        private var editable:TextField;
        
        public function EditManager_example()
        {
            //define TextFlow
            tf = new TextFlow();
            
            //define elements to contain text
            var p:ParagraphElement = new ParagraphElement();
            var s:SpanElement = new SpanElement();
            s.text ="This is sample text for the EditManager example.";
            
            //add these elements to the TextFlow
            p.addChild(s);
            tf.addChild(p);    
            
            //compose TextFlow to display
            var tfController:ContainerController = new ContainerController(this,600,600);
            tfController.container.y = 10
            tf.flowComposer.addController(tfController);
            tf.flowComposer.updateAllControllers();
            
            //define TextFlow manager objects
            um = new UndoManager();
            em = new EditManager(um);
            tf.interactionManager = null;
            
            createEditButton();
        }
        
        private function createEditButton ():void {
            editable = new TextField();
            editable.appendText("Click to make the sample text editable");
            editable.x = 0;
            editable.y = 50;
            editable.width = 150;
            editable.autoSize = flash.text.TextFieldAutoSize.LEFT;
            editable.selectable = false;
            editable.background = true;
            editable.backgroundColor = 0xAAAAAA;
            
            addChild(editable);
            editable.addEventListener(MouseEvent.CLICK, updateEditable);
        }
        
        private function updateEditable(me:MouseEvent):void{
            if (editable.text.indexOf("read only") >= 0) {
                editable.text = "Click to make the sample text editable";
                tf.interactionManager = null;
            }
            else {
                editable.text = "Click to make the sample text read only";
                tf.interactionManager = em;                
            }
            
        }
    }        
}