DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Mark has posted 3 posts at DZone. View Full User Profile

Flex 3 Combo Box Code

06.11.2008
| 15353 views |
  • submit to reddit
        // description of your code here
Easiest way to populate a combo box.

var valueArray:Array = new Array();
          var emptyItem:Object = new Object();
          emptyItem.data = "";
          emptyItem.label = "";
          var buildingItem:Object = new Object();
          buildingItem.data = "building";
          buildingItem.label = "Building";
          var regionItem:Object = new Object();
          regionItem.data = "region";
          regionItem.label = "Region"        
          valueArray.push(emptyItem);
          valueArray.push(buildingItem);
          valueArray.push(regionItem);          
          
          filterComboBox = new ComboBox();
          filterComboBox.dataProvider = valueArray;
          filterComboBox.addEventListener(ListEvent.CHANGE, filterUpdate);