Flex Combo Box example

The following code demonstrates the ComboBox Control working example. This Control shows the drop-down list of data you passed as String inside it.

Flex Combo Box example

Flex Combo Box example

     

In this tutorial page you will be taught to utilize ComboBox control inside your flex file. In the example you will learn to build two ComboBox controls. The Example below shows combo boxes with nicely formatted string data, so here you will be also taught to do the graphical works on flex visual component. 

The following code demonstrates the ComboBox control working example. This control shows the drop-down list of data you passed as String inside it.

 combo.mxml

<?xml version = '1.0' encoding = 'utf-8'?>
<mx:Application xmlns:mx = 'http://www.adobe.com/2006/mxml'>
  <mx:Panel title = 'Megara (Hercules)' width = '70%
  height = '40%' color = '#FFFFCF'>
  <mx:Canvas backgroundColor = '#CCCCFC' width = 
  '100%' height = '100%'>

  <mx:ComboBox color = 'red'>
  <mx:dataProvider>
  <mx:Array>
  <mx:String> Neo/ Thomas Anderson 
  </mx:String>
  <mx:String> Trinity/ Carrie-Anne Moss
 </mx:String>
  <mx:String> Eve/ Rachel Weisz 
  </mx:String>
  </mx:Array>
  </mx:dataProvider>
  </mx:ComboBox>


  <mx:ComboBox x = '200' color = 'green'> 
  <mx:dataProvider>
  <mx:Array>
  <mx:String> Snow White - Adriana Caselotti
 </mx:String>
  <mx:String> Aurora - Mary Costa </mx:String>
  <mx:String> Ariel - Jodi Benson </mx:String>
  </mx:Array>
  </mx:dataProvider>
  </mx:ComboBox>
  
  </mx:Canvas>
  </mx:Panel>

</mx:Application>

 

combo.swf

 

Download the code