XML Store Locator with a link to google maps

I need help and direction with a XML Store Locator with a link to google maps. Basically, I was asked by my company to make a store locator for our website but I only have basic knowledge of Actionscript and XML. What I would like to do is have an Input text box with a search button and an dynamic text box to display the results. Whatever is typed into the input box is what I want to search the XML file for.

I would like to have 6 variables to search for and 1 variable that holds the URL info:(StoreName, Address, City, StateShort, StateLong , ZipCode, Link).

Now For example if someone typed “CA” or “California” all entries that have CA as its StateShort or California as it’s StateLong atribute would be displayed, something for the rest as well.

In addition to displaying the info in the text box I would like the output to be links so that I can link the location to a popup of the location in google maps.

Here is how I my XML file looks:

<?xml version="1.0"?>
<root>
 <StoreEntry>
  <StoreName>Joes Hardware</StoreName>
  <Address>1234 Main Street</Address>
  <City>Somewhere USA</City>
  <StateShort>CA</StateShort>
  <StateLong>California</StateLong>
  <ZipCode>99999</ZipCode>
  <Link>http://maps.google.com</Link>
 </StoreEntry>
 <StoreEntry>
  <StoreName>Jims Bakery</StoreName>
  <Address>4321 Muffin Street</Address>
  <City>Elsewhere USA</City>
  <StateShort>MA</StateShort>
  <StateLong>Massachusetts</StateLong>
  <ZipCode>99991</ZipCode>
  <Link>http://maps.google.com</Link>
 </StoreEntry>
 <StoreEntry>
  <StoreName>Jacks Bate and Tackle</StoreName>
  <Address>498762 Fishhook Ave.</Address>
  <City>A Place USA</City>
  <StateShort>FL</StateShort>
  <StateLong>Florida</StateLong>
  <ZipCode>11111</ZipCode>
  <Link>http://maps.google.com</Link>
 </StoreEntry>
</root>

Here is my Actionscript so far, Please note I didn’t write this code I copied and modified it to my needs. I’m not this knowledgeable about AS.

var myXML:XML = new XML();//creating XML object
var StoreName_arr:Array=new Array()//array objects to hold StoreName data from xml
var Address_arr:Array=new Array()//array objects to hold Address data from xml
var City_arr:Array=new Array()
var StateShort_arr:Array=new Array()
var StateLong_arr:Array=new Array()
var ZipCode_arr:Array=new Array()
 
 
myXML.ignoreWhite = true;//white spaces will be discarded
 
myXML.onLoad = function() 
{//function will be call when xml file data loaded into xml object 
 var full_arr:Array=this.firstChild.childNodes//here we have array of child nodes
 var len:Number=full_arr.length-1//getting the no of child nodes
 for(var i:Number=0;i<=len;i++)//looping trough the values
 {
  StoreName_arr*=full_arr*.childNodes[0].firstChild//storing StoreName values in array
  Address_arr*=full_arr*.childNodes[1].firstChild //storing Address details in array 
  City_arr*=full_arr*.childNodes[2].firstChild
  StateShort_arr*=full_arr*.childNodes[3].firstChild
  StateLong_arr*=full_arr*.childNodes[4].firstChild
  ZipCode_arr*=full_arr*.childNodes[5].firstChild
 
  trace([StoreName_arr*,Address_arr*,City_arr*,StateLong_arr*,ZipCode_arr*,newline]);
  displaytxt.text = StoreName_arr* + "          " + Address_arr*  + "          " + City_arr*  + "          " + StateLong_arr* + "          " + ZipCode_arr*;
 }
 
}
 
myXML.load("sample.xml");//loading the xml file data into xml object

I can display an entry in the XML in flash. However it keeps displaying only the last one. I think I am going to need assistance fixing this.

I am still trying to implement the search feature but I still don’t know how yet. And last but not least, making the text clickable.

My guess is that I need to make invisible movie clips and place them over the text box in rows. Then add some sort of generic on (release) function that grabs the link of the line of text beneath it.

seeing that I am in uncharted territory (for me), any help will be really appreciated.

Thanks in advance.