Question
Making a "search" box...
Okay, let's say I have an XML file like this:
<?xml version="1.0" encoding="iso-8859-1"?>
<pages>
<page url="01.swf" search="one" />
<page url="02.swf" search="two,2" />
<page url="03.swf" search="three,3,tres" />
</pages>
Then, in Flash, I have loaded the XML file into a "navXML" variable, thereby "two,2" would be the value of "navXML.firstChild.childNodes[1].attributes.search", for example...
Making sense so far? - good!...
I want to make a search box. Basically a text entry box (say, "search_txt") that when a MC is pressed (say, "search_mc"), it will take the text in the search box and check to see if that text falls into any of the "search" attributes of that XML file....
I know this would involve a "for" loop, and I'm sure I'd have to first somehow parse the data in the "search" attributes by a "," (since some of the "search" attributes have more than one value), and maybe put them into an Array or something?...
I dunno - I know that this is a lot of questions at once, but I just wanted to give out my whole scenario so that hopefully someone could give me some idea of how to get started. Like, if my thinking is correct (above), then I suppose my first question would be how to get the "search" data paresed out by the "," and into Arrays?...
(or, maybe I'm WAY off base, and someone has made a better version of this that they can share!)
Thanks!...
<?xml version="1.0" encoding="iso-8859-1"?>
<pages>
<page url="01.swf" search="one" />
<page url="02.swf" search="two,2" />
<page url="03.swf" search="three,3,tres" />
</pages>
Then, in Flash, I have loaded the XML file into a "navXML" variable, thereby "two,2" would be the value of "navXML.firstChild.childNodes[1].attributes.search", for example...
Making sense so far? - good!...
I want to make a search box. Basically a text entry box (say, "search_txt") that when a MC is pressed (say, "search_mc"), it will take the text in the search box and check to see if that text falls into any of the "search" attributes of that XML file....
I know this would involve a "for" loop, and I'm sure I'd have to first somehow parse the data in the "search" attributes by a "," (since some of the "search" attributes have more than one value), and maybe put them into an Array or something?...
I dunno - I know that this is a lot of questions at once, but I just wanted to give out my whole scenario so that hopefully someone could give me some idea of how to get started. Like, if my thinking is correct (above), then I suppose my first question would be how to get the "search" data paresed out by the "," and into Arrays?...
(or, maybe I'm WAY off base, and someone has made a better version of this that they can share!)
Thanks!...