| Package | km.components |
| Class | public class List |
| Inheritance | List ScrollPane UIComponent flash.display.Sprite |
| Property | Defined by | ||
|---|---|---|---|
| allowMultipleSelection : Boolean Gets or sets a Boolean value indicating if more than one item can be selected.
| List | ||
| altColorTransform : ColorTransform Gets or sets a color transform for odd numbered rows.
| List | ||
![]() | background : Image
>> Reference to the background image.
| ScrollPane | |
![]() | duotone : Array The duotone property can be used to convert the colors of the component into duotone.
| UIComponent | |
![]() | enabled : Boolean Specifies if the component is enabled.
If a component is disabled, it will be turned into grayscale and become partly transparent. | UIComponent | |
![]() | height : Number | UIComponent | |
| htmlLabels : Boolean Gets or sets a Boolean value indicating if item labels should be displayed as html text or plain text.
| List | ||
| iconField : String Gets or sets the name of the field that contains the item label icon.
| List | ||
| labelField : String Gets or sets the name of the field that contains the item label text.
| List | ||
| length : uint [read-only] Gets the number of items in the list.
| List | ||
| listItem : ListItem [read-only] >> Reference to the default list item.
| List | ||
![]() | margin : int The margin between the bounding box of the background and the sub components inside.
| ScrollPane | |
| onChange : Function onChange handler.
| List | ||
| selectable : Boolean Gets or sets a Boolean value indicating if items can be selected.
| List | ||
| selectedIndex : int Gets or sets the index of the selected item.
| List | ||
| selectedIndices : Array Gets or sets an array containing the indices of the selected items.
| List | ||
| selectedItem : Object Gets or sets the selected item.
| List | ||
| selectedItems : Array Gets or sets an array that containing the selected items.
| List | ||
![]() | toolTip : String Text to use as toolTip when ToolTip is enabled.
| UIComponent | |
![]() | vScrollBar : ScrollBar
>> Reference to the vertical scrollBar.
| ScrollPane | |
![]() | width : Number | UIComponent | |
![]() | x : Number | UIComponent | |
![]() | y : Number | UIComponent | |
| Method | Defined by | ||
|---|---|---|---|
|
List()
| List | ||
|
addItem(item:Object):void
Adds an item to the end of the item list.
| List | ||
|
addItemAt(item:Object, index:int):void
Adds an item at the specified index.
| List | ||
|
addItemsAt(items:Array, index:int):void
Inserts multiple items at the specified index.
| List | ||
|
clearSelection():void
Clears the selected items in the list.
| List | ||
![]() |
clone():*
Returns a clone of the component.
The skin of the component is cloned but other things like the text of a label or the items of a list aren't. | UIComponent | |
|
getAll():Array
Retrieves all items.
| List | ||
|
getItemAt(index:int):Object
Retrieves the item at the specified index.
| List | ||
|
getItemIndex(item:Object):int
Retrieves the index of the specified item.
| List | ||
|
isItemSelected(item:Object):Boolean
Checks if the specified item is selected.
| List | ||
![]() |
move(x:int, y:int, animationMode:int = 0, animationFrames:int = 12, easeInOut:Boolean = false):void
Moves the component to the specified coordinates.
| UIComponent | |
|
removeAll():void
Removes all items from the list.
| List | ||
|
removeItem(item:Object):Object
Removes the specified item from the list.
| List | ||
|
removeItemAt(index:int):Object
Removes the item at the specified index position from the list.
| List | ||
|
removeSelectedItems():Array
Removes all selected items from the list.
| List | ||
|
replaceItemAt(item:Object, index:int):Object
Replaces the item at the specified index with another item.
| List | ||
|
scrollToIndex(index:int):void
Scrolls the list to the item at the specified index.
| List | ||
|
selectAll():void
Selects all items.
| List | ||
|
setDataXML(data:*, sort:int = 0, labelFunction:Function = null, iconFunction:Function = null):void
Set the list data.
data can be of the type XML or URLRequest. sort can be 0 (no sort), 1 (ascending), 2 (descending). iconFunction if provided should be a function that accepts one parameter for the item object and returns the icon bitmap data. | List | ||
|
setItemArray(itemArray:Array):void
Specifies the array to use for items.
| List | ||
![]() |
setProperties(o:Object):void
Sets a number of properties at once.
| UIComponent | |
![]() |
setSize(w:int, h:int):void
Sets the size width and height.
| UIComponent | |
|
shuffleItems():void
Shuffles all items.
| List | ||
|
sortItemsOn(field:String, options:Object = null):*
Sorts the items of the list according to one or more item fields.
| List | ||
| Event | Summary | Defined by | ||
|---|---|---|---|---|
![]() | The animationComplete event is broadcasted when an animated move is completed. | UIComponent | ||
| The change event is broadcasted when a different item is selected. When the selection is changed by scripting, the event is not broadcasted. It's also possible to use the onChange handler. | List | |||
| The noChange event is broadcasted when an already selected item is clicked again. | List | |||
| The setDataComplete event is broadcasted when the setDataXML function has completed. | List | |||
| The setDataError event is broadcasted when the setDataXML function has failed. | List | |||
| allowMultipleSelection | property |
allowMultipleSelection:Boolean [read-write]Gets or sets a Boolean value indicating if more than one item can be selected.
Implementation public function get allowMultipleSelection():Boolean
public function set allowMultipleSelection(value:Boolean):void
| altColorTransform | property |
altColorTransform:ColorTransform [read-write]Gets or sets a color transform for odd numbered rows.
Implementation public function get altColorTransform():ColorTransform
public function set altColorTransform(value:ColorTransform):void
| htmlLabels | property |
htmlLabels:Boolean [read-write]Gets or sets a Boolean value indicating if item labels should be displayed as html text or plain text.
Implementation public function get htmlLabels():Boolean
public function set htmlLabels(value:Boolean):void
| iconField | property |
iconField:String [read-write]Gets or sets the name of the field that contains the item label icon.
Implementation public function get iconField():String
public function set iconField(value:String):void
| labelField | property |
labelField:String [read-write]Gets or sets the name of the field that contains the item label text.
Implementation public function get labelField():String
public function set labelField(value:String):void
| length | property |
length:uint [read-only]Gets the number of items in the list.
Implementation public function get length():uint
| listItem | property |
listItem:ListItem [read-only]>> Reference to the default list item.
Implementation public function get listItem():ListItem
See also
| onChange | property |
public var onChange:FunctiononChange handler.
| selectable | property |
selectable:Boolean [read-write]Gets or sets a Boolean value indicating if items can be selected.
Implementation public function get selectable():Boolean
public function set selectable(value:Boolean):void
| selectedIndex | property |
selectedIndex:int [read-write]Gets or sets the index of the selected item.
Implementation public function get selectedIndex():int
public function set selectedIndex(value:int):void
| selectedIndices | property |
selectedIndices:Array [read-write]Gets or sets an array containing the indices of the selected items.
Implementation public function get selectedIndices():Array
public function set selectedIndices(value:Array):void
| selectedItem | property |
selectedItem:Object [read-write]Gets or sets the selected item.
Implementation public function get selectedItem():Object
public function set selectedItem(value:Object):void
| selectedItems | property |
selectedItems:Array [read-write]Gets or sets an array that containing the selected items.
Implementation public function get selectedItems():Array
public function set selectedItems(value:Array):void
| List | () | constructor |
public function List()
| addItem | () | method |
public function addItem(item:Object):voidAdds an item to the end of the item list.
Parametersitem:Object — The item to add.
|
| addItemAt | () | method |
public function addItemAt(item:Object, index:int):voidAdds an item at the specified index.
Parametersitem:Object — The item to add.
|
|
index:int — The index where the item has to be added before.
You can use a negative value to specify a position relative to the end of the list (for example, -1 is the last item of the list).
|
| addItemsAt | () | method |
public function addItemsAt(items:Array, index:int):voidInserts multiple items at the specified index.
Parametersitems:Array — The items to be added.
|
|
index:int — The index where the items have to be added before.
You can use a negative value to specify a position relative to the end of the list (for example, -1 is the last item of the list).
|
| clearSelection | () | method |
public function clearSelection():voidClears the selected items in the list.
| getAll | () | method |
public function getAll():ArrayRetrieves all items.
ReturnsArray — All items.
|
| getItemAt | () | method |
public function getItemAt(index:int):ObjectRetrieves the item at the specified index.
Parametersindex:int — The index of the item to retrieve.
You can use a negative value to specify a position relative to the end of the list (for example, -1 is the last item of the list).
|
Object — The retrieved item.
|
| getItemIndex | () | method |
public function getItemIndex(item:Object):intRetrieves the index of the specified item.
Parametersitem:Object — The item to search for.
|
int — The index of the specified item or -1 when the item can't be found.
|
| isItemSelected | () | method |
public function isItemSelected(item:Object):BooleanChecks if the specified item is selected.
Parametersitem:Object — The item to search for.
|
Boolean — A Boolean value indicating if the item is currently selected or not.
|
| removeAll | () | method |
public function removeAll():voidRemoves all items from the list.
| removeItem | () | method |
public function removeItem(item:Object):ObjectRemoves the specified item from the list.
Parametersitem:Object — The item to remove.
|
Object — The removed item.
|
| removeItemAt | () | method |
public function removeItemAt(index:int):ObjectRemoves the item at the specified index position from the list.
Parametersindex:int — The index of the item to remove.
You can use a negative value to specify a position relative to the end of the list (for example, -1 is the last item of the list).
|
Object — The removed item.
|
| removeSelectedItems | () | method |
public function removeSelectedItems():ArrayRemoves all selected items from the list.
ReturnsArray — The removed items.
|
| replaceItemAt | () | method |
public function replaceItemAt(item:Object, index:int):ObjectReplaces the item at the specified index with another item.
Parametersitem:Object — The item to add.
|
|
index:int — The index where the item has to be replaced.
You can use a negative value to specify a position relative to the end of the list (for example, -1 is the last item of the list).
|
Object — The removed item.
|
| scrollToIndex | () | method |
public function scrollToIndex(index:int):voidScrolls the list to the item at the specified index. You can use a negative value to specify a position relative to the end of the list (for example, -1 is the last item of the list).
Parametersindex:int |
| selectAll | () | method |
public function selectAll():voidSelects all items.
| setDataXML | () | method |
public function setDataXML(data:*, sort:int = 0, labelFunction:Function = null, iconFunction:Function = null):void Set the list data.
data can be of the type XML or URLRequest.
sort can be 0 (no sort), 1 (ascending), 2 (descending).
iconFunction if provided should be a function that accepts one parameter for the item object and returns the icon bitmap data.
data:* |
|
sort:int (default = 0) |
|
labelFunction:Function (default = null) |
|
iconFunction:Function (default = null) |
import km.components.*;
import km.skins.*;
var listData:XML =
<data>
<item label='Mail account 1' value ='account 1' />
<item label='Mail account 2' value ='account 2' />
<item label='Mail account 3' value ='account 3' />
</data>;
var list:List = new List();
ScriptedSkin.applyTo(list);
list.setSize(140, 100);
list.move(10,10);
addChild(list);
list.setDataXML(listData);
| setItemArray | () | method |
public function setItemArray(itemArray:Array):voidSpecifies the array to use for items. By default an internal array is used but this function allows you to specify another one.
ParametersitemArray:Array — The array to use.
|
| shuffleItems | () | method |
public function shuffleItems():voidShuffles all items.
| sortItemsOn | () | method |
public function sortItemsOn(field:String, options:Object = null):*Sorts the items of the list according to one or more item fields.
Parametersfield:String — The field to sort on.
|
|
options:Object (default = null) — Optional options to control the sorting process.
|
* |
See also
| change | event |
flash.events.Event
The change event is broadcasted when a different item is selected.
When the selection is changed by scripting, the event is not broadcasted.
It's also possible to use the onChange handler.
| noChange | event |
flash.events.Event
The noChange event is broadcasted when an already selected item is clicked again.
| setDataComplete | event |
flash.events.Event
The setDataComplete event is broadcasted when the setDataXML function has completed.
| setDataError | event |
flash.events.Event
The setDataError event is broadcasted when the setDataXML function has failed.