This has been a few months since I have started this journey.
I am pulling in the csv file correctly.
I have an input text field that I would like to use to search and list zip codes.
You had posted a search function
function zipF(zip:String):DataProvider{
var dp_zipA:Array=[];
for(var i:int=0;i<dpA.length;i++){
if(dpA.Zip==zip){
dp_zipA.push({"Business":dpA.Business,"Name":dpA.Name,"Address":dpA.Address,"City ":dpA.City,"State":dpA.State});
}
}
return new DataProvider(dp_zipA);
}
I am trying to understand it.
Do I give the input text field the property name zipF? Or create a sep button?
Again I am sorry for being such a noob. But this is very exciting!
you call the zipF and pass the zip code (as a string). zipF returns a dataprovider of matching zip codes. each object contains all the data you showed was in your csv file.
if your input textfield is input_tf, you could use:
somebtn.addEventListener(MouseEvent.CLICK,searchF);
function searchF(e:MouseEvent):void{
// i assume you want to display this in datagrid, eg dg
dg.dataProvider=zipF(input_tf.text);
}