| Use labelFunction to provide label text for ComboBox |
|
|
 |
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="500"
height="600">
<mx:Script>
import mx.events.*;
import mx.collections.*;
public function myLabelFunc(item:Object):String {
return item.first + " " + item.last;
}
</mx:Script>
<mx:ArrayCollection id="ac">
<mx:source>
<mx:Object first="A" last="Q" email="[email protected]" />
<mx:Object first="B" last="W" email="[email protected]" />
<mx:Object first="C" last="E" email="[email protected]" />
</mx:source>
</mx:ArrayCollection>
<mx:ComboBox id="cb" dataProvider="{ac}" labelFunction="myLabelFunc" />
</mx:Application>
|
|
|
|
| Related examples in the same category |