Adobe® Flex® 4 Language Reference
Hide Packages and Classes List |  Packages  |  Classes  |  Index  |  Appendixes
flashx.textLayout.edit 
SelectionState 
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



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
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  pointFormat : flashx.textLayout.formats:ITextLayoutFormat
The format attributes applied to inserted text.
SelectionState
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
 InheritedtextFlow : flashx.textLayout.elements:TextFlow
Returns the TextFlow associated with the selection.
TextRange
Public Methods
 MethodDefined By
  
Creates a SelectionState object.
SelectionState
 Inherited
Indicates whether an object has a specified property defined.
Object
 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 specified property exists and is enumerable.
Object
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 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
  
updateRange(newAnchorPosition:int, newActivePosition:int):Boolean
[override] Updates the selection range with new anchor or active position values.
SelectionState
 Inherited
Returns the primitive value of the specified object.
Object
Property Detail

pointFormat

property
pointFormat:flashx.textLayout.formats: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 getCommonCharacterFormats() method of the ISelectionManager class.



Implementation
    public function get pointFormat():flashx.textLayout.formats:ITextLayoutFormat
    public function set pointFormat(value:flashx.textLayout.formats:ITextLayoutFormat):void

See also

selectionManagerOperationState

property 
selectionManagerOperationState:Boolean



Implementation
    tlf_internal function get selectionManagerOperationState():Boolean
    tlf_internal function set selectionManagerOperationState(value:Boolean):void
Constructor Detail

SelectionState

()Constructor
public function SelectionState(root:flashx.textLayout.elements:TextFlow, anchorPosition:int, activePosition:int, format:flashx.textLayout.formats:ITextLayoutFormat = 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:flashx.textLayout.elements:TextFlow — The TextFlow associated with the selection.
 
anchorPosition:int — The anchor index of the selection.
 
activePosition:int — The active index of the selection.
 
format:flashx.textLayout.formats:ITextLayoutFormat (default = null) — The TextLayoutFormat to be applied on next character typed when a point selection

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