Please, give me an advise how to make a search of a number in xml-file (as3.0)
Hello! Sorry for troubling.
Please, give me an advice how to make a search of a number in xml-file (as3.0)
Thank you!
Hello! Sorry for troubling.
Please, give me an advice how to make a search of a number in xml-file (as3.0)
Thank you!
My response was based on your question of finding numbers anywhere in the data of an xml file. If you know the data is numeric data and the names of the nodes containing that data, then you do not have to check characters and can just check the number data using the string values....
function searchXMLFile(Event:MouseEvent):void
{
searchDisplay.text = "";
var pageList:XMLList = xmlFileToSearch.receipt.number;
searchDisplay.text = "false";
for (var i:int = 0; i < pageList.length(); i++)
{
if(pageList == searchInput.text){
searchDisplay.text = "true";
}
}
}
Even if you were looking for individual numeric characters in your previous code you would always have ended up with a false output due to have the "false" line always canceling the true line...
if (t.toString().indexOf(m_sSearchTerm) != -1)
{
searchDisplay.text = "true";
}
searchDisplay.text = "false"; // this will always overwrite the textfield
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.