Packageflashx.textLayout.edit
Classpublic class SelectionState
InheritanceSelectionState Inheritance TextRange Inheritance Object

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

The SelectionState class represents a selection in a text flow.

A selection range has an anchor point, representing the point at which the selection of text began, and an active point, representing the point to which the selection is extended. The active point can be before or after the anchor point in the text. If a selection is modified (for example, by a user shift-clicking with the mouse), the active point changes while the anchor point always remains in the same position.

See also

flashx.textLayout.edit.ISelectionManager.getSelectionState()
flashx.textLayout.elements.TextFlow
flashx.textLayout.elements.TextRange


Public Properties
 PropertyDefined By
 InheritedabsoluteEnd : int
End of the selection, as an absolute position in the TextFlow.
TextRange
 InheritedabsoluteStart : int
Start of the selection, as an absolute position in the TextFlow.
TextRange
 InheritedactivePosition : int
Active position of the selection, as an absolute position in the TextFlow.
TextRange
 InheritedanchorPosition : int
Anchor position of the selection, as an absolute position in the TextFlow.
TextRange
  cellRange : CellRange
Range of table cells in selection (null if no cells selected)
SelectionState
  pointFormat : ITextLayoutFormat
The format attributes applied to inserted text.
SelectionState
 InheritedtextFlow : TextFlow
Returns the TextFlow associated with the selection.
TextRange
Public Methods
 MethodDefined By
  
SelectionState(root:TextFlow, anchorPosition:int, activePosition:int, format:ITextLayoutFormat = null, cellRange:CellRange = null)
Creates a SelectionState object.
SelectionState
  
updateRange(newAnchorPosition:int, newActivePosition:int):Boolean
[override] Updates the selection range with new anchor or active position values.
SelectionState
Property Detail
cellRangeproperty
cellRange:CellRange

Range of table cells in selection (null if no cells selected)


Implementation
    public function get cellRange():CellRange
    public function set cellRange(value:CellRange):void
pointFormatproperty 
pointFormat:ITextLayoutFormat

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

The format attributes applied to inserted text.

Note: The pointFormat object does not include inherited styles. To get all the applicable style definitions, use the getCommonCharacterFormat() method of the ISelectionManager class.


Implementation
    public function get pointFormat():ITextLayoutFormat
    public function set pointFormat(value:ITextLayoutFormat):void

See also

Constructor Detail
SelectionState()Constructor
public function SelectionState(root:TextFlow, anchorPosition:int, activePosition:int, format:ITextLayoutFormat = null, cellRange:CellRange = null)

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

Creates a SelectionState object.

Note: Do not construct a SelectionState object in order to create a selection. To create a selection in a text flow, call the setSelection() method of the relevant ISelectionManager instance (which is the SelectionManager or EditManager object assigned to the interactionManager property of the text flow).

Parameters
root:TextFlow — The TextFlow associated with the selection.
 
anchorPosition:int — The anchor index of the selection.
 
activePosition:int — The active index of the selection.
 
format:ITextLayoutFormat (default = null) — The TextLayoutFormat to be applied on next character typed when a point selection
 
cellRange:CellRange (default = null)

See also

Method Detail
updateRange()method
override public function updateRange(newAnchorPosition:int, newActivePosition:int):Boolean

Updates the selection range with new anchor or active position values.

The pointFormat styles are cleared if the selection is changed.

Parameters

newAnchorPosition:int — the anchor index of the selection.
 
newActivePosition:int — the active index of the selection.

Returns
Boolean — true if selection is changed