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

CollectionEvent  - AS3 Flex

mx.events
public class CollectionEvent
继承CollectionEvent Inheritance Event Inheritance Object

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: Flash Player 9, AIR 1.1

mx.events.CollectionEvent 类表示在相关联的集合发生更改时调度的事件。

相关 API 元素



公共属性
 属性由以下参数定义
 Inheritedbubbles : Boolean
[只读] 表示事件是否为冒泡事件。
Event
 Inheritedcancelable : Boolean
[只读] 表示是否可以阻止与事件相关联的行为。
Event
 Inheritedconstructor : Object
对类对象或给定对象实例的构造函数的引用。
Object
 InheritedcurrentTarget : Object
[只读] 当前正在使用某个事件侦听器处理 Event 对象的对象。
Event
 InheritedeventPhase : uint
[只读] 事件流中的当前阶段。
Event
  items : Array
如果 kind 为 CollectionEventKind.ADD 或 CollectionEventKind.REMOVE,则 items 属性为已添加/已删除项目的 Array。
CollectionEvent
  kind : String
指示发生的事件类型。
CollectionEvent
  location : int
如果 kind 值为 CollectionEventKind.ADD、CollectionEventKind.MOVE、CollectionEventKind.REMOVE 或 CollectionEventKind.REPLACE,则此属性为 items 属性中指定的项目集合中基于零的索引。
CollectionEvent
  oldLocation : int
如果 kind 的值为 CollectionEventKind.MOVE,则此属性为 items 属性中指定的项目在目标集合中原来位置的从零开始的索引。
CollectionEvent
 Inheritedtarget : Object
[只读] 事件目标。
Event
 Inheritedtype : String
[只读] 事件的类型。
Event
公共方法
 方法由以下参数定义
  
CollectionEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, kind:String = null, location:int = -1, oldLocation:int = -1, items:Array = null)
构造函数。
CollectionEvent
 Inherited
复制 Event 子类的实例。
Event
 Inherited
formatToString(className:String, ... arguments):String
用于在自定义 ActionScript 3.0 Event 类中实现 toString() 方法的实用程序函数。
Event
 Inherited
表示对象是否已经定义了指定的属性。
Object
 Inherited
检查是否已对事件调用 preventDefault() 方法。
Event
 Inherited
表示 Object 类的实例是否在指定为参数的对象的原型链中。
Object
 Inherited
如果可以取消事件的默认行为,则取消该行为。
Event
 Inherited
表示指定的属性是否存在、是否可枚举。
Object
 Inherited
设置循环操作动态属性的可用性。
Object
 Inherited
防止对事件流中当前节点中和所有后续节点中的事件侦听器进行处理。
Event
 Inherited
防止对事件流中当前节点的后续节点中的所有事件侦听器进行处理。
Event
 Inherited
返回此对象的字符串表示形式,其格式设置遵守区域设置特定的约定。
Object
 Inherited
返回一个字符串,其中包含 Event 对象的所有属性。
Event
 Inherited
返回指定对象的原始值。
Object
公共常量
 常量由以下参数定义
  COLLECTION_CHANGE : String = "collectionChange"
[静态] CollectionEvent.COLLECTION_CHANGE 常量可为在集合发生更改时调度的事件定义事件对象的 type 属性值。
CollectionEvent
属性详细信息

items

属性
public var items:Array

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: Flash Player 9, AIR 1.1

如果 kindCollectionEventKind.ADDCollectionEventKind.REMOVE,则 items 属性为已添加/已删除项目的 Array。如果 kindCollectionEventKind.REPLACECollectionEventKind.UPDATE,则 items 属性为 PropertyChangeEvent 对象 Array,其中包含受事件影响的项目的相关信息。如果值发生更改,请查询 PropertyChangeEvent 对象的 newValueoldValue 字段以了解原来的值和新值。如果 kindCollectionEventKind.REFRESHCollectionEventKind.RESET,则此数组的长度为零。

默认值为 [ ]。

相关 API 元素

kind

属性 
public var kind:String

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: Flash Player 9, AIR 1.1

指示发生的事件类型。此属性值可以是 CollectionEventKind 类中的一个值,也可以是 null,用于指示类型未知。

默认值为 null。

相关 API 元素

location

属性 
public var location:int

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: Flash Player 9, AIR 1.1

如果 kind 值为 CollectionEventKind.ADDCollectionEventKind.MOVECollectionEventKind.REMOVECollectionEventKind.REPLACE,则此属性为 items 属性中指定的项目集合中基于零的索引。

默认值为 -1。

相关 API 元素

oldLocation

属性 
public var oldLocation:int

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: Flash Player 9, AIR 1.1

如果 kind 的值为 CollectionEventKind.MOVE,则此属性为 items 属性中指定的项目在目标集合中原来位置的从零开始的索引。

默认值为 -1。

构造函数详细信息

CollectionEvent

()构造函数
public function CollectionEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, kind:String = null, location:int = -1, oldLocation:int = -1, items:Array = null)

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: Flash Player 9, AIR 1.1

构造函数。

参数
type:String — 事件类型;指示触发事件的动作。
 
bubbles:Boolean (default = false) — 指定该事件是否可以在显示列表层次结构得到冒泡处理。
 
cancelable:Boolean (default = false) — 指定是否可以防止与事件相关联的行为。
 
kind:String (default = null) — 指示发生的事件类型。此参数值可以是 CollectionEventKind 类中的一个值,也可以是 null,用于指示类型未知。
 
location:int (default = -1)kindCollectionEventKind.ADDCollectionEventKind.MOVECollectionEventKind.REMOVECollectionEventKind.REPLACE 时,此值指示可以在目标集合中找到 items 属性中指定的项目的位置。
 
oldLocation:int (default = -1)kindCollectionEventKind.MOVE 时,此值指示 items 属性中指定的项目在目标集合中的原位置。
 
items:Array (default = null) — 对象数组,其中包含有关受事件影响的项目的信息,如 items 属性所述。如果 kindCollectionEventKind.REFRESHCollectionEventKind.RESET,则此 Array 的长度为零。
常量详细信息

COLLECTION_CHANGE

常量
public static const COLLECTION_CHANGE:String = "collectionChange"

语言版本: ActionScript 3.0
产品版本: Flex 3
运行时版本: Flash Player 9, AIR 1.1

CollectionEvent.COLLECTION_CHANGE 常量可为在集合发生更改时调度的事件定义事件对象的 type 属性值。

事件对象的属性具有下列值。并非所有属性对于各种事件都有意义。有关详细信息,请参阅详细的属性说明。

属性
bubblesfalse
cancelablefalse
currentTarget用于定义处理该事件的事件侦听器的对象。例如,如果您使用 myButton.addEventListener() 注册某个事件侦听器,则 myButton 为 currentTarget 的值。
items对象 Array,其中包含有关受事件影响的项目的信息。此字段的内容取决于事件的类型;有关详细信息,请参阅 items 属性
kind事件的类型。有效值定义为 CollectionEventKind 类中的常量。
locationitems 属性中指定的项目在目标集合中的位置。
oldLocationitems 属性中指定的项目原来在目标集合中的位置。
target调度该事件的 Object;它不一定是侦听该事件的 Object。使用 currentTarget 属性始终可以访问侦听事件的 Object。
typeCollectionEvent.COLLECTION_CHANGE





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

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