Description
Property; the name of the field in
property of the List component that is available from a ComboBox component instance. For
more information, see
The default value is
Example
The following example sets the
property to indicate that the
labelField
drop-down list:
myComboBox.dataProvider = [
{name:"Gary", gender:"male"},
{name:"Susan", gender:"female"} ];
myComboBox.labelField = "name";
See also
List.labelFunction
ComboBox.labelFunction
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX 2004.
Usage
myComboBox.labelFunction
Description
Property; a function that computes the label of a data provider item. You must define the
function. The default value is
Example
The following example creates a data provider and then defines a function to specify what to use
as the label in the drop-down list:
myComboBox.dataProvider
{firstName:"Nigel", lastName:"Pegg", age:"really young"},
{firstName:"Gary", lastName:"Grossman", age:"young"},
{firstName:"Chris", lastName:"Walcott", age:"old"},
{firstName:"Greg", lastName:"Yachuk", age:"really old"} ];
myComboBox.labelFunction = function(itemObj){
return (itemObj.lastName + ", " + itemObj.firstName);
}
198
Chapter 6: Components Dictionary
dataProvider
.
List.labelField
.
undefined
dataProvider
.
undefined
= [
array objects to use as the label field. This is a
property to an array of strings and sets the
field should be used as the label for the
name
Need help?
Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?
Questions and answers