包mx.collections
ç±»public class ArrayCollection
继承ArrayCollection Inheritance ListCollectionView Inheritance Proxy Inheritance Object
实现 IExternalizable

ArrayCollection 类是将 Array 公开为集�的�装类,�使用 ICollectionView 或 IList 接�的方法和属性进行访问和处�。对 ArrayCollection 实例进行�作会修改数��;例如,如果对 ArrayCollection 使用 removeItemAt() 方法,就会删除基础 Array 中的项目。

MXML 语法expanded�� MXML 语法

The <mx:ArrayCollection> tag inherits all the attributes of its superclass, and adds the following attributes:

  <mx:ArrayCollection
  Properties
  source="null"
  />
  

默认 MXML 属性source

�请��

Using Data Providers and Collections


公共属性
 å±žæ€§å®šä¹‰æ–¹
 Inheritedconstructor : Object
对类对象或给定对象实例的构造函数的引用。
Object
 InheritedfilterFunction : Function
视图用�消除�符�函数�件的项目的函数。
ListCollectionView
 Inheritedlength : int
[�读 (read-only)] 此视图中的项目数。
ListCollectionView
 Inheritedlist : IList
此集�视图所�装的 IList。
ListCollectionView
 Inheritedprototype : Object
[��] 对类或函数对象的原型对象的引用。
Object
 Inheritedsort : Sort
将应用于 ICollectionView 的排�。
ListCollectionView
  source : Array
ArrayCollection 中的数��。
ArrayCollection
��护的属性
 å±žæ€§å®šä¹‰æ–¹
 InheritedlocalIndex : Array
视图�过排�或过滤�,localIndex 属性会在排�或过滤�(已排��已缩�)的视图中包�按排�顺�显示的项目的数组。
ListCollectionView
公共方法
 æ–¹æ³•定义方
  
ArrayCollection(source:Array = null)
构造函数。
ArrayCollection
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
使用 EventDispatcher 对象注册事件侦�器对象,以使侦�器能够接收事件通知。
ListCollectionView
 Inherited
�列表末尾添加指定项目。
ListCollectionView
 Inherited
addItemAt(item:Object, index:int):void
在指定的索引处添加项目。
ListCollectionView
 Inherited
返回指示视图是�包�指定对象的信�。
ListCollectionView
 Inherited
创建使用此视图的新 IViewCursor。
ListCollectionView
 Inherited
防止视图调度对集�本身和集�中的项目的更改。
ListCollectionView
 Inherited
将事件调度到事件�中。
ListCollectionView
 Inherited
�用自动更新。
ListCollectionView
 Inherited
getItemAt(index:int, prefetch:int = 0):Object
获�指定索引处的项目。
ListCollectionView
 Inherited
如果项目�于列表中(这样的� getItemAt(index) == item),则返回该项目的索引。
ListCollectionView
 Inherited
检查 EventDispatcher 对象是�为特定事件类型注册了任何侦�器。
ListCollectionView
 Inherited
指示对象是�已�定义了指定的属性。
Object
 Inherited
如果 ListCollectionView 是使用 MXML 标签创建的,则由 MXML 编译器自动调用。
ListCollectionView
 Inherited
指示 Object 类的实例是�在指定为�数的对象的原型链中。
Object
 Inherited
itemUpdated(item:Object, property:Object = null, oldValue:Object = null, newValue:Object = null):void
通知视图,�个项目已更新。
ListCollectionView
 Inherited
指示指定的属性是�存在�是��枚举。
Object
 Inherited
将排�和滤镜应用到视图。
ListCollectionView
 Inherited
删除列表中的所有项目。
ListCollectionView
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
从 EventDispatcher 对象中删除侦�器。
ListCollectionView
 Inherited
删除指定索引处的项目并返回该项目。
ListCollectionView
 Inherited
setItemAt(item:Object, index:int):Object
在指定的索引处放置项目。
ListCollectionView
 Inherited
设置循环�作动�属性的�用性。
Object
 Inherited
返回与 IList 实现的填充顺�相�的 Array。
ListCollectionView
 Inherited
将此视图的内容输出到字符串并返回该字符串。
ListCollectionView
 Inherited
返回指定对象的原始值。
Object
 Inherited
检查是�用此 EventDispatcher 对象或其任何始祖为指定事件类型注册了事件侦�器。
ListCollectionView
事件
 äº‹ä»¶ 摘è¦� 定义方
 Inherited以æŸ�ç§�æ–¹å¼�æ›´æ–° ICollectionView å�Žè°ƒåº¦ã€‚ListCollectionView
属性详细信�
source属性
source:Array  [读写]

ArrayCollection 中的数��。ArrayCollection 对象��供对�数组进行的任何直接更改。始终使用 ICollectionView 或 IList 方法修改该集�。

此属性�用作数�绑定的�。修改此属性�,将调度 listChanged 事件。



实现
    public function get source():Array
    public function set source(value:Array):void
构造函数详细信�
ArrayCollection()构造函数
public function ArrayCollection(source:Array = null)

构造函数。

使用指定的�数组创建新的 ArrayCollection。如果未指定数组,将使用空数组。

�数
source:Array (default = null)