(Beta)
Package | fl.controls.listClasses |
Class | public class ListData |
Inheritance | ListData ![]() |
Subclasses | TileListData |
Language Version: | ActionScript 3.0 |
Product Version: | Flash CS3 |
Runtime Versions: | Flash Player 9.0.28.0, AIR 1.0 |
A new ListData component is created for a cell renderer each time it is invalidated.
Public Properties
Property | Defined By | ||
---|---|---|---|
![]() | constructor : Object
A reference to the class object or constructor function for a given object instance. | Object |
Public Methods
Method | Defined By | ||
---|---|---|---|
![]() |
Indicates whether an object has a specified property defined. | Object | |
![]() |
Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter. | Object | |
![]() |
Indicates whether the specified property exists and is enumerable. | Object | |
![]() |
Sets the availability of a dynamic property for loop operations. | Object | |
![]() |
Returns the string representation of this object, formatted according to locale-specific conventions. | Object | |
![]() |
Returns the string representation of the specified object. | Object | |
![]() |
Returns the primitive value of the specified object. | Object |
Property Detail
Constructor Detail
Examples How to use this example
ListDataExample.as
This example illustrates how to access the
listData
property of a cell renderer.
To run the example, follow these steps:
- Add the List and Button components to the library.
- Save this code as ListDataExample.as in the same directory as your FLA file.
- Set the Document class in the FLA file to ListDataExample.
package { import fl.controls.List; import fl.controls.listClasses.CellRenderer; import fl.controls.listClasses.ListData; import fl.events.ListEvent; import flash.display.Sprite; import flash.events.Event; import flash.text.TextField; public class ListDataExample extends Sprite { var sampleItem1:Object = { label:"John Alpha" }; var sampleItem2:Object = { label:"Mary Bravo" }; var sampleItem3:Object = { label:"Trevor Gamma" }; var sampleItem4:Object = { label:"Susan Delta" }; var myList:List; var tf:TextField; public function ListDataExample() { createList(); tf = new TextField(); tf.x = 10; tf.y = 125; addChild(tf); } private function createList():void { myList = new List(); myList.move(10,10); myList.addItem(sampleItem1); myList.addItem(sampleItem2); myList.addItem(sampleItem3); myList.addItem(sampleItem4); myList.rowCount = 4; myList.addEventListener(ListEvent.ITEM_CLICK,listItemSelected); addChild(myList); } private function listItemSelected(e:ListEvent):void { var cr:CellRenderer = myList.itemToCellRenderer(e.item) as CellRenderer; var listData:ListData = cr.listData; tf.text = "Row selected: " + listData.row; } } }
Wed Nov 21 2018, 06:34 AM -08:00