ActionScript 2.0 Components Language Reference |
|
|
|
| List component > List.labelFunction | |||
Flash Player 6 (6.0.79.0).
Flash MX 2004.
listInstance.labelFunction
Property; specifies a function that determines which field (or field combination) of each item to display. This function receives one parameter, item, which is the item being rendered, and must return a string representing the text to display.
The following example makes the label display some formatted details of the items:
var my_list:mx.controls.List;
my_list.setSize(300, 100);
// Define how list data will be displayed.
my_list.labelFunction = function(item_obj:Object):String {
var label_str:String = item_obj.label + " - Code is: " + item_obj.data;
return label_str;
}
// Add data to list.
my_list.addItem({data:"f", label:"Flash"});
my_list.addItem({data:"d", label:"Dreamweaver"});
my_list.addItem({data:"c", label:"ColdFusion"});
|
|
|
|