Packageflashx.textLayout.elements
Classpublic class TextRange
InheritanceTextRange Inheritance Object
Subclasses SelectionState

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

A read only class that describes a range of contiguous text. Such a range occurs when you select a section of text. The range consists of the anchor point of the selection, anchorPosition, and the point that is to be modified by actions, activePosition. As block selections are modified and extended anchorPosition remains fixed and activePosition is modified. The anchor position may be placed in the text before or after the active position.

See also

TextFlow
SelectionState


Public Properties
 PropertyDefined By
  absoluteEnd : int
End of the selection, as an absolute position in the TextFlow.
TextRange
  absoluteStart : int
Start of the selection, as an absolute position in the TextFlow.
TextRange
  activePosition : int
Active position of the selection, as an absolute position in the TextFlow.
TextRange
  anchorPosition : int
Anchor position of the selection, as an absolute position in the TextFlow.
TextRange
  textFlow : TextFlow
Returns the TextFlow associated with the selection.
TextRange
Public Methods
 MethodDefined By
  
TextRange(root:TextFlow, anchorIndex:int, activeIndex:int)
Constructor - creates a new TextRange instance.
TextRange
  
updateRange(newAnchorPosition:int, newActivePosition:int):Boolean
Update the range with new anchor or active position values.
TextRange
Property Detail
absoluteEndproperty
absoluteEnd:int

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

End of the selection, as an absolute position in the TextFlow.


Implementation
    public function get absoluteEnd():int
    public function set absoluteEnd(value:int):void
absoluteStartproperty 
absoluteStart:int

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

Start of the selection, as an absolute position in the TextFlow.


Implementation
    public function get absoluteStart():int
    public function set absoluteStart(value:int):void
activePositionproperty 
activePosition:int

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

Active position of the selection, as an absolute position in the TextFlow.


Implementation
    public function get activePosition():int
    public function set activePosition(value:int):void
anchorPositionproperty 
anchorPosition:int

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

Anchor position of the selection, as an absolute position in the TextFlow.


Implementation
    public function get anchorPosition():int
    public function set anchorPosition(value:int):void
textFlowproperty 
textFlow:TextFlow

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

Returns the TextFlow associated with the selection.


Implementation
    public function get textFlow():TextFlow
    public function set textFlow(value:TextFlow):void
Constructor Detail
TextRange()Constructor
public function TextRange(root:TextFlow, anchorIndex:int, activeIndex:int)

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

Constructor - creates a new TextRange instance. A TextRange can be (-1,-1), indicating no range, or a pair of values from 0 to TextFlow.textLength.

Parameters
root:TextFlow — the TextFlow associated with the selection.
 
anchorIndex:int — the index position of the anchor in the selection. The first position in the text is position 0.
 
activeIndex:int — the index position of the active location in the selection. The first position in the text is position 0.

See also

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

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

Update the range with new anchor or active position values.

Parameters

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

Returns
Boolean — true if selection is changed.