用于 Adobe® Flash® Platform 的 ActionScript® 3.0 参考
主页  |  隐藏包列表和类列表 |   |   |  新增内容  |  索引  |  附录  |  为什么显示为英语?
过滤条件: 正在从服务器检索数据...
正在从服务器检索数据...
flashx.textLayout.edit 

SelectionState  - AS3

flashx.textLayout.edit
public class SelectionState
继承SelectionState Inheritance TextRange Inheritance Object

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

SelectionState 类表示文本流中的所选项目。

选择范围有一个锚点,表示开始选择文本的点,还有一个活动点,表示选择结束的点。在文本中活动点可以位于锚点之前或之后。如果修改了选择(例如用户按 Shift 键并单击时),则活动点会随之改变,而锚点始终保持其位置不变。

相关 API 元素



公共属性
 属性由以下参数定义
 InheritedabsoluteEnd : int
选择部分的终点,是 TextFlow 中的绝对位置。
TextRange
 InheritedabsoluteStart : int
选择部分的起点,是 TextFlow 中的绝对位置。
TextRange
 InheritedactivePosition : int
选择部分的活动点位置,是 TextFlow 中的绝对位置。
TextRange
 InheritedanchorPosition : int
选择部分的锚点位置,是 TextFlow 中的绝对位置。
TextRange
 Inheritedconstructor : Object
对类对象或给定对象实例的构造函数的引用。
Object
  pointFormat : flashx.textLayout.formats:ITextLayoutFormat
已应用到插入文本的格式属性。
SelectionState
 InheritedtextFlow : flashx.textLayout.elements:TextFlow
返回与选择部分相关联的 TextFlow。
TextRange
公共方法
 方法由以下参数定义
  
创建 SelectionState 对象。
SelectionState
 Inherited
表示对象是否已经定义了指定的属性。
Object
 Inherited
表示 Object 类的实例是否在指定为参数的对象的原型链中。
Object
 Inherited
表示指定的属性是否存在、是否可枚举。
Object
 Inherited
设置循环操作动态属性的可用性。
Object
 Inherited
返回此对象的字符串表示形式,其格式设置遵守区域设置特定的约定。
Object
 Inherited
返回指定对象的字符串表示形式。
Object
  
updateRange(newAnchorPosition:int, newActivePosition:int):Boolean
[覆盖] 使用新锚点或活动位置值更新当前选择范围。
SelectionState
 Inherited
返回指定对象的原始值。
Object
属性详细信息

pointFormat

属性
pointFormat:flashx.textLayout.formats:ITextLayoutFormat

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

已应用到插入文本的格式属性。

注意:pointFormat 对象不包含继承的样式。要获取所有适用的样式定义,请使用 ISelectionManager 类的 getCommonCharacterFormat() 方法。



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

相关 API 元素

构造函数详细信息

SelectionState

()构造函数
public function SelectionState(root:flashx.textLayout.elements:TextFlow, anchorPosition:int, activePosition:int, format:flashx.textLayout.formats:ITextLayoutFormat = null)

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

创建 SelectionState 对象。

注意:请勿为了创建选择而构造 SelectionState 对象。要在文本流中进行选择,请调用相关 ISelectionManager 实例(是指定给文本流 interactionManager 属性的 SelectionManager 或 EditManager 对象)的 setSelection() 方法。

参数
root:flashx.textLayout.elements:TextFlow — 与选择相关联的 TextFlow。
 
anchorPosition:int — 所选项目的锚点索引。
 
activePosition:int — 所选项目的活动点索引。
 
format:flashx.textLayout.formats:ITextLayoutFormat (default = null) — 应用于进行点选择时键入的下一个字符的 TextLayoutFormat

相关 API 元素

方法详细信息

updateRange

()方法
override public function updateRange(newAnchorPosition:int, newActivePosition:int):Boolean

使用新锚点或活动位置值更新当前选择范围。

如果已更改当前选择,则清除 pointFormat 样式。

参数

newAnchorPosition:int — 所选项目的锚点索引。
 
newActivePosition:int — 所选项目的活动点索引。

返回
Boolean — 如果已更改当前选择,则为 true




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

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