I would like to add codes to search so able to perform similar way when type on a text box.
rzufelt -I still try to work on the ideas you gave. I will give you a feedback later. I appreaciate your time.
Bjorn - I try work on similar way header controller has on esearch widget or locate widget. Haven't got any success yet. Basically just like google search when you type in a text box, it will give you some char to choose. Robert has this on his search widget on his GIS site.
I hope can give a starting point from here. Thanks all.
xmlns:managers="com.yahoo.astra.mx.managers.*"
<fx:Declarations>
<managers:AutoCompleteManager
maxRowCount="9"
id="autoCompleteMgr"
dataProvider="{myXML.name}"
target="{txtItem}"
minCharsForCompletion="1"
autoFillEnabled="true"/>
</fx:Declarations>
\\Based on the first digit of the address . . . it loads a different xml.
if (clickedInTextInput == true && txtItem.text.length >= 4 && addrSearchVis == true) {
txtItem.text = txtItem.text.toUpperCase();
if (int(txtItem.text.charAt(0)) >= 6 && int(txtItem.text.charAt(0)) >= 6) {
XML_URL = "com/a" + txtItem.text.charAt(0) + ".xml";
}
if (int(txtItem.text.charAt(0)) <= 5) {
if (int(txtItem.text.charAt(1)) <= 9) {
XML_URL = "com/a" + txtItem.text.charAt(0) + "8a" + txtItem.text.charAt(0) + "9.xml";
}
if (int(txtItem.text.charAt(1)) <= 7) {
XML_URL = "com/a" + txtItem.text.charAt(0) + "6a" + txtItem.text.charAt(0) + "7.xml";
}
if (int(txtItem.text.charAt(1)) <= 5) {
XML_URL = "com/a" + txtItem.text.charAt(0) + "4a" + txtItem.text.charAt(0) + "5.xml";
}
if (int(txtItem.text.charAt(1)) <= 3) {
XML_URL = "com/a" + txtItem.text.charAt(0) + "2a" + txtItem.text.charAt(0) + "3.xml";
}
if (int(txtItem.text.charAt(1)) <= 1) {
XML_URL = "com/a" + txtItem.text.charAt(0) + "0a" + txtItem.text.charAt(0) + "1.xml";
}
}
var myXMLURL:URLRequest = new URLRequest(XML_URL);
var myLoader:URLLoader = new URLLoader(myXMLURL);
myLoader.addEventListener("complete", xmlLoaded);
}
function xmlLoaded(evtObj:Event):void
{
myXML = new XML();
myXML = XML(myLoader.data);
myLoader.removeEventListener("complete", xmlLoaded);
autoCompleteMgr.openDropdownForTarget(txtItem);
}