Referenshandbok för ActionScript® 3.0 i Adobe® Flash®-plattformen
Hem  |  Dölj paket och klasslista |  Paket  |  Klasser  |  Nyheter  |  Index  |  Bilagor  |  Varför på engelska?
Filter: Hämtar data från servern ...
Hämtar data från servern ...
mx.collections 

IList  - AS3 Flex

Paketmx.collections
Gränssnittpublic interface IList extends IEventDispatcher
Implementorer ArrayList, AsyncListView, ListCollectionView, NumericDataProvider

Språkversion: ActionScript 3.0
Produktversion: Flex 3
Körningsmiljöversioner: Flash Player 9, AIR 1.1

A collection of items organized in an ordinal fashion. Provides access and manipulation methods based on index.

An IList may be a view onto data that has been retrieved from a remote location. When writing for a collection that may be remote, it is important to handle the case where data may not yet be available, which is indicated by the ItemPendingError.

The ICollectionView is an alternative to the IList.

Relaterade API-element



Publika egenskaper
 EgenskapDefinieras med
  length : int
[skrivskyddad] The number of items in this collection.
IList
Publika metoder
 MetodDefinieras med
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registrerar ett händelseavlyssnarobjekt för ett EventDispatcher-objekt så att avlyssnaren får meddelanden om händelser.
IEventDispatcher
  
Adds the specified item to the end of the list.
IList
  
addItemAt(item:Object, index:int):void
Adds the item at the specified index.
IList
 Inherited
Skickar en händelse till händelseflödet.
IEventDispatcher
  
getItemAt(index:int, prefetch:int = 0):Object
Gets the item at the specified index.
IList
  
Returns the index of the item if it is in the list such that getItemAt(index) == item.
IList
 Inherited
Kontrollerar om EventDispatcher-objektet har några avlyssnare registrerade för en viss typ av händelse.
IEventDispatcher
  
itemUpdated(item:Object, property:Object = null, oldValue:Object = null, newValue:Object = null):void
Notifies the view that an item has been updated.
IList
  
Removes all items from the list.
IList
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Tar bort en avlyssnare från EventDispatcher-objektet.
IEventDispatcher
  
Removes the item at the specified index and returns it.
IList
  
setItemAt(item:Object, index:int):Object
Places the item at the specified index.
IList
  
Returns an Array that is populated in the same order as the IList implementation.
IList
 Inherited
Kontrollerar om en händelseavlyssnare är registrerad för det här EventDispatcher-objektet eller något av dess överordnade objekt för den angivna händelsetypen.
IEventDispatcher
Händelser
 Händelse Sammanfattning Definieras med
  Dispatched when the IList has been updated in some way.IList
Egenskapsdetaljer

length

egenskap
length:int  [skrivskyddad]

Språkversion: ActionScript 3.0
Produktversion: Flex 3
Körningsmiljöversioner: Flash Player 9, AIR 1.1

The number of items in this collection. 0 means no items while -1 means the length is unknown.



Implementering
    public function get length():int
Metoddetaljer

addItem

()metod
public function addItem(item:Object):void

Språkversion: ActionScript 3.0
Produktversion: Flex 3
Körningsmiljöversioner: Flash Player 9, AIR 1.1

Adds the specified item to the end of the list. Equivalent to addItemAt(item, length).

Parametrar

item:Object — The item to add.

addItemAt

()metod 
public function addItemAt(item:Object, index:int):void

Språkversion: ActionScript 3.0
Produktversion: Flex 3
Körningsmiljöversioner: Flash Player 9, AIR 1.1

Adds the item at the specified index. The index of any item greater than the index of the added item is increased by one. If the the specified index is less than zero or greater than the length of the list, a RangeError is thrown.

Parametrar

item:Object — The item to place at the index.
 
index:int — The index at which to place the item.


Utlöser
RangeError — if index is less than 0 or greater than the length of the list.

getItemAt

()metod 
public function getItemAt(index:int, prefetch:int = 0):Object

Språkversion: ActionScript 3.0
Produktversion: Flex 3
Körningsmiljöversioner: Flash Player 9, AIR 1.1

Gets the item at the specified index.

Parametrar

index:int — The index in the list from which to retrieve the item.
 
prefetch:int (default = 0) — An int indicating both the direction and number of items to fetch during the request if the item is not local.

Returnerar
Object — The item at that index, or null if there is none.

Utlöser
ItemPendingError — if the data for that index needs to be loaded from a remote location.
 
RangeError — if index < 0 or index >= length.

getItemIndex

()metod 
public function getItemIndex(item:Object):int

Språkversion: ActionScript 3.0
Produktversion: Flex 3
Körningsmiljöversioner: Flash Player 9, AIR 1.1

Returns the index of the item if it is in the list such that getItemAt(index) == item.

Note: unlike IViewCursor.findxxx() methods, The getItemIndex() method cannot take a parameter with only a subset of the fields in the item being serched for; this method always searches for an item that exactly matches the input parameter.

Parametrar

item:Object — The item to find.

Returnerar
int — The index of the item, or -1 if the item is not in the list.

itemUpdated

()metod 
public function itemUpdated(item:Object, property:Object = null, oldValue:Object = null, newValue:Object = null):void

Språkversion: ActionScript 3.0
Produktversion: Flex 3
Körningsmiljöversioner: Flash Player 9, AIR 1.1

Notifies the view that an item has been updated. This is useful if the contents of the view do not implement IEventDispatcher and dispatches a PropertyChangeEvent. If a property is specified the view may be able to optimize its notification mechanism. Otherwise it may choose to simply refresh the whole view.

Parametrar

item:Object — The item within the view that was updated.
 
property:Object (default = null) — The name of the property that was updated.
 
oldValue:Object (default = null) — The old value of that property. (If property was null, this can be the old value of the item.)
 
newValue:Object (default = null) — The new value of that property. (If property was null, there's no need to specify this as the item is assumed to be the new value.)

Relaterade API-element

removeAll

()metod 
public function removeAll():void

Språkversion: ActionScript 3.0
Produktversion: Flex 3
Körningsmiljöversioner: Flash Player 9, AIR 1.1

Removes all items from the list.

If any item is not local and an asynchronous operation must be performed, an ItemPendingError will be thrown.

See the ItemPendingError documentation as well as the collections documentation for more information on using the ItemPendingError.

removeItemAt

()metod 
public function removeItemAt(index:int):Object

Språkversion: ActionScript 3.0
Produktversion: Flex 3
Körningsmiljöversioner: Flash Player 9, AIR 1.1

Removes the item at the specified index and returns it. Any items that were after this index are now one index earlier.

Parametrar

index:int — The index from which to remove the item.

Returnerar
Object — The item that was removed.

Utlöser
RangeError — is index is less than 0 or greater than length.

setItemAt

()metod 
public function setItemAt(item:Object, index:int):Object

Språkversion: ActionScript 3.0
Produktversion: Flex 3
Körningsmiljöversioner: Flash Player 9, AIR 1.1

Places the item at the specified index. If an item was already at that index the new item will replace it and it will be returned.

Parametrar

item:Object — The new item to be placed at the specified index.
 
index:int — The index at which to place the item.

Returnerar
Object — The item that was replaced, or null if none.

Utlöser
RangeError — if index is less than 0 or greater than length.

toArray

()metod 
public function toArray():Array

Språkversion: ActionScript 3.0
Produktversion: Flex 3
Körningsmiljöversioner: Flash Player 9, AIR 1.1

Returns an Array that is populated in the same order as the IList implementation. This method can throw an ItemPendingError.

Returnerar
Array — The array.

Utlöser
ItemPendingError — If the data is not yet completely loaded from a remote location.
Händelsedetaljer

collectionChange

Händelse
Typ av händelseobjekt: mx.events.CollectionEvent
egenskap CollectionEvent.type = mx.events.CollectionEvent.COLLECTION_CHANGE

Språkversion: ActionScript 3.0
Produktversion: Flex 3
Körningsmiljöversioner: Flash Player 9, AIR 1.1

Dispatched when the IList has been updated in some way.

The CollectionEvent.COLLECTION_CHANGE constant defines the value of the type property of the event object for an event that is dispatched when a collection has changed.

The properties of the event object have the following values. Not all properties are meaningful for all kinds of events. See the detailed property descriptions for more information.

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
itemsAn Array of objects with information about the items affected by the event. The contents of this field depend on the event kind; for details see the items property
kindThe kind of event. The valid values are defined in the CollectionEventKind class as constants.
locationLocation within the target collection of the item(s) specified in the items property.
oldLocationthe previous location in the collection of the item specified in the items property.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
typeCollectionEvent.COLLECTION_CHANGE




[ X ]Varför på engelska?
Innehåll i Referenshandbok för ActionScript 3.0 i Adobe Flash-plattformen är på engelska

Det är inte alla delar av Referenshandbok för ActionScript 3.0 i Adobe Flash-plattformen som översätts till alla språk. Om ett språkelement inte översätts visas det på engelska. Klassen ga.controls.HelpBox översätts till exempel inte till något språk. I den svenska versionen av referenshandboken visas därför klassen ga.controls.HelpBox på engelska.