flex selecting combobox httpservice

im trying to select an item coming back from an HTTPservice i
called...i get a return of say "NY" now i want that item preselected
in the combobox


 public function state_select(){
                
                val =
"{stations_placeofbusiness.lastResult.DATARESULTS.STATE}";
                
                
                for (var i: int = 0; i < state.dataProvider.length; i++) {
                  if ( val == state.dataProvider[i].label) {
                    state.dataProvider.selectedIndex = i;
                    
                    
                    
                    break;
                  }    
                }
                
            } 






<mx:ComboBox x="102" y="62" id="state" labelField="@name"
dataProvider="{statesXMLList}" creationComplete="state_select();"/>



Reply via email to