chartermatrix
09-28-2008, 06:06 PM
Here is the function I am currently using to loop through the values of the data provider object in search of a labal. I would rather use the data provider method getItemIndex(obj) but am not sure how pass the obj parameter when all i have to search for is the label (string)
Any suggestions would be appreciated.
var dp:DataProvider = new DataProvider();
function search(e:Event):void
{
var string:String = cp.txt_search.text;
string= string.toUpperCase();
if(aXMLAircrafts[string] != undefined)
{
for(var i = 0; i < dp.length; i++)
{
if(dp.getItemAt(i).label == string)
{
cp.cb.selectedIndex = i;
}
}
}
}
Any suggestions would be appreciated.
var dp:DataProvider = new DataProvider();
function search(e:Event):void
{
var string:String = cp.txt_search.text;
string= string.toUpperCase();
if(aXMLAircrafts[string] != undefined)
{
for(var i = 0; i < dp.length; i++)
{
if(dp.getItemAt(i).label == string)
{
cp.cb.selectedIndex = i;
}
}
}
}