1 2 Previous Next 41 Replies Latest reply on Sep 29, 2006 2:31 PM by Newsgroup_User

    Making a "search" box...

    DIY_Lobotomy Level 1
      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!...
        • 1. Re: Making a &quot;search&quot; box...
          TimSymons Level 1
          I did not test this but you could start with something like this and probably optimize it for speed.



          Tim


          • 2. Re: Making a &quot;search&quot; box...
            Level 7

            "TimSymons" <webforumsuser@macromedia.com> wrote in message
            news:efjpj9$fhk$1@forums.macromedia.com...
            >I did not test this but you could start with something like this and
            >probably
            > optimize it for speed.
            >
            >
            >
            > Tim
            >
            >
            >
            >
            > // search_txt, search_mc already exist on timeline
            > //
            > // assume also that the following XML data was read/parsed into the navXML
            > variable:
            > /*
            > <?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>
            > */
            >
            > search_mc.onRelease = searchXML;
            >
            > function searchXML():XMLNode {
            > var searchStr:String = search_txt.text.toLowerCase();
            > var i:Number;
            > var j:Number;
            > var nodeIndex:Number;
            >
            > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
            > var searchArr:Array = new Array();
            > searchArr =
            > String(navXML.firstChild.childNodes .attributes.search).split(",");
            > for (j=0; j<searchArr.length; j++) {
            > if (searchStr == searchArr[j].toLowerCase()) {
            > nodeIndex = i;
            > break;
            > }
            > }
            > if (nodeIndex != undefined) {
            > break;
            > }
            > }
            >
            > return navXML.firstChild.childNodes[nodeIndex];
            > }
            >


            Couple things here. I am not sure what you are returning to? search_mc is
            a MovieClip, so you are returning a Node to the onRelease? Think that may
            be a typo.

            As far as speed... couple things. I am not sure about actionscript and its
            lookup times for executions like this... but, first things first.

            You actually don't need to break up the string into other words. Thanks to
            the indexOf method of the String Class. You can just do a test
            if (yoursearchValue.indexOf(searchWord) > -1) {
            found it
            }

            I also think you may be better served parsing your XML into a native Flash
            Datatype like an Array of Object like this:
            myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
            keywords:"two,2"}]

            To build that Array you could do the loop like listed in the previous reply.
            Then when you do your search you would just loop this array of objects
            checking for the indexOf on the keywords property.

            I also think it depends on how much data you are going to be handling here.
            The parsing into the myFinisedObject gets better the more stuff you give it
            I think (again I am not sure how fast it is in comparison - but if you try
            it, let me know)



            • 3. Re: Making a &quot;search&quot; box...
              Level 7

              "TimSymons" <webforumsuser@macromedia.com> wrote in message
              news:efjpj9$fhk$1@forums.macromedia.com...
              >I did not test this but you could start with something like this and
              >probably
              > optimize it for speed.
              >
              >
              >
              > Tim
              >
              >
              >
              >
              > // search_txt, search_mc already exist on timeline
              > //
              > // assume also that the following XML data was read/parsed into the navXML
              > variable:
              > /*
              > <?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>
              > */
              >
              > search_mc.onRelease = searchXML;
              >
              > function searchXML():XMLNode {
              > var searchStr:String = search_txt.text.toLowerCase();
              > var i:Number;
              > var j:Number;
              > var nodeIndex:Number;
              >
              > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
              > var searchArr:Array = new Array();
              > searchArr =
              > String(navXML.firstChild.childNodes .attributes.search).split(",");
              > for (j=0; j<searchArr.length; j++) {
              > if (searchStr == searchArr[j].toLowerCase()) {
              > nodeIndex = i;
              > break;
              > }
              > }
              > if (nodeIndex != undefined) {
              > break;
              > }
              > }
              >
              > return navXML.firstChild.childNodes[nodeIndex];
              > }
              >


              Couple things here. I am not sure what you are returning to? search_mc is
              a MovieClip, so you are returning a Node to the onRelease? Think that may
              be a typo.

              As far as speed... couple things. I am not sure about actionscript and its
              lookup times for executions like this... but, first things first.

              You actually don't need to break up the string into other words. Thanks to
              the indexOf method of the String Class. You can just do a test
              if (yoursearchValue.indexOf(searchWord) > -1) {
              found it
              }

              I also think you may be better served parsing your XML into a native Flash
              Datatype like an Array of Object like this:
              myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
              keywords:"two,2"}]

              To build that Array you could do the loop like listed in the previous reply.
              Then when you do your search you would just loop this array of objects
              checking for the indexOf on the keywords property.

              I also think it depends on how much data you are going to be handling here.
              The parsing into the myFinisedObject gets better the more stuff you give it
              I think (again I am not sure how fast it is in comparison - but if you try
              it, let me know)



              • 4. Re: Making a &quot;search&quot; box...
                Level 7

                "TimSymons" <webforumsuser@macromedia.com> wrote in message
                news:efjpj9$fhk$1@forums.macromedia.com...
                >I did not test this but you could start with something like this and
                >probably
                > optimize it for speed.
                >
                >
                >
                > Tim
                >
                >
                >
                >
                > // search_txt, search_mc already exist on timeline
                > //
                > // assume also that the following XML data was read/parsed into the navXML
                > variable:
                > /*
                > <?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>
                > */
                >
                > search_mc.onRelease = searchXML;
                >
                > function searchXML():XMLNode {
                > var searchStr:String = search_txt.text.toLowerCase();
                > var i:Number;
                > var j:Number;
                > var nodeIndex:Number;
                >
                > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                > var searchArr:Array = new Array();
                > searchArr =
                > String(navXML.firstChild.childNodes .attributes.search).split(",");
                > for (j=0; j<searchArr.length; j++) {
                > if (searchStr == searchArr[j].toLowerCase()) {
                > nodeIndex = i;
                > break;
                > }
                > }
                > if (nodeIndex != undefined) {
                > break;
                > }
                > }
                >
                > return navXML.firstChild.childNodes[nodeIndex];
                > }
                >


                Couple things here. I am not sure what you are returning to? search_mc is
                a MovieClip, so you are returning a Node to the onRelease? Think that may
                be a typo.

                As far as speed... couple things. I am not sure about actionscript and its
                lookup times for executions like this... but, first things first.

                You actually don't need to break up the string into other words. Thanks to
                the indexOf method of the String Class. You can just do a test
                if (yoursearchValue.indexOf(searchWord) > -1) {
                found it
                }

                I also think you may be better served parsing your XML into a native Flash
                Datatype like an Array of Object like this:
                myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                keywords:"two,2"}]

                To build that Array you could do the loop like listed in the previous reply.
                Then when you do your search you would just loop this array of objects
                checking for the indexOf on the keywords property.

                I also think it depends on how much data you are going to be handling here.
                The parsing into the myFinisedObject gets better the more stuff you give it
                I think (again I am not sure how fast it is in comparison - but if you try
                it, let me know)



                • 5. Re: Making a &quot;search&quot; box...
                  Level 7

                  "TimSymons" <webforumsuser@macromedia.com> wrote in message
                  news:efjpj9$fhk$1@forums.macromedia.com...
                  >I did not test this but you could start with something like this and
                  >probably
                  > optimize it for speed.
                  >
                  >
                  >
                  > Tim
                  >
                  >
                  >
                  >
                  > // search_txt, search_mc already exist on timeline
                  > //
                  > // assume also that the following XML data was read/parsed into the navXML
                  > variable:
                  > /*
                  > <?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>
                  > */
                  >
                  > search_mc.onRelease = searchXML;
                  >
                  > function searchXML():XMLNode {
                  > var searchStr:String = search_txt.text.toLowerCase();
                  > var i:Number;
                  > var j:Number;
                  > var nodeIndex:Number;
                  >
                  > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                  > var searchArr:Array = new Array();
                  > searchArr =
                  > String(navXML.firstChild.childNodes .attributes.search).split(",");
                  > for (j=0; j<searchArr.length; j++) {
                  > if (searchStr == searchArr[j].toLowerCase()) {
                  > nodeIndex = i;
                  > break;
                  > }
                  > }
                  > if (nodeIndex != undefined) {
                  > break;
                  > }
                  > }
                  >
                  > return navXML.firstChild.childNodes[nodeIndex];
                  > }
                  >


                  Couple things here. I am not sure what you are returning to? search_mc is
                  a MovieClip, so you are returning a Node to the onRelease? Think that may
                  be a typo.

                  As far as speed... couple things. I am not sure about actionscript and its
                  lookup times for executions like this... but, first things first.

                  You actually don't need to break up the string into other words. Thanks to
                  the indexOf method of the String Class. You can just do a test
                  if (yoursearchValue.indexOf(searchWord) > -1) {
                  found it
                  }

                  I also think you may be better served parsing your XML into a native Flash
                  Datatype like an Array of Object like this:
                  myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                  keywords:"two,2"}]

                  To build that Array you could do the loop like listed in the previous reply.
                  Then when you do your search you would just loop this array of objects
                  checking for the indexOf on the keywords property.

                  I also think it depends on how much data you are going to be handling here.
                  The parsing into the myFinisedObject gets better the more stuff you give it
                  I think (again I am not sure how fast it is in comparison - but if you try
                  it, let me know)



                  • 6. Re: Making a &quot;search&quot; box...
                    Level 7

                    "TimSymons" <webforumsuser@macromedia.com> wrote in message
                    news:efjpj9$fhk$1@forums.macromedia.com...
                    >I did not test this but you could start with something like this and
                    >probably
                    > optimize it for speed.
                    >
                    >
                    >
                    > Tim
                    >
                    >
                    >
                    >
                    > // search_txt, search_mc already exist on timeline
                    > //
                    > // assume also that the following XML data was read/parsed into the navXML
                    > variable:
                    > /*
                    > <?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>
                    > */
                    >
                    > search_mc.onRelease = searchXML;
                    >
                    > function searchXML():XMLNode {
                    > var searchStr:String = search_txt.text.toLowerCase();
                    > var i:Number;
                    > var j:Number;
                    > var nodeIndex:Number;
                    >
                    > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                    > var searchArr:Array = new Array();
                    > searchArr =
                    > String(navXML.firstChild.childNodes .attributes.search).split(",");
                    > for (j=0; j<searchArr.length; j++) {
                    > if (searchStr == searchArr[j].toLowerCase()) {
                    > nodeIndex = i;
                    > break;
                    > }
                    > }
                    > if (nodeIndex != undefined) {
                    > break;
                    > }
                    > }
                    >
                    > return navXML.firstChild.childNodes[nodeIndex];
                    > }
                    >


                    Couple things here. I am not sure what you are returning to? search_mc is
                    a MovieClip, so you are returning a Node to the onRelease? Think that may
                    be a typo.

                    As far as speed... couple things. I am not sure about actionscript and its
                    lookup times for executions like this... but, first things first.

                    You actually don't need to break up the string into other words. Thanks to
                    the indexOf method of the String Class. You can just do a test
                    if (yoursearchValue.indexOf(searchWord) > -1) {
                    found it
                    }

                    I also think you may be better served parsing your XML into a native Flash
                    Datatype like an Array of Object like this:
                    myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                    keywords:"two,2"}]

                    To build that Array you could do the loop like listed in the previous reply.
                    Then when you do your search you would just loop this array of objects
                    checking for the indexOf on the keywords property.

                    I also think it depends on how much data you are going to be handling here.
                    The parsing into the myFinisedObject gets better the more stuff you give it
                    I think (again I am not sure how fast it is in comparison - but if you try
                    it, let me know)



                    • 7. Re: Making a &quot;search&quot; box...
                      Level 7

                      "TimSymons" <webforumsuser@macromedia.com> wrote in message
                      news:efjpj9$fhk$1@forums.macromedia.com...
                      >I did not test this but you could start with something like this and
                      >probably
                      > optimize it for speed.
                      >
                      >
                      >
                      > Tim
                      >
                      >
                      >
                      >
                      > // search_txt, search_mc already exist on timeline
                      > //
                      > // assume also that the following XML data was read/parsed into the navXML
                      > variable:
                      > /*
                      > <?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>
                      > */
                      >
                      > search_mc.onRelease = searchXML;
                      >
                      > function searchXML():XMLNode {
                      > var searchStr:String = search_txt.text.toLowerCase();
                      > var i:Number;
                      > var j:Number;
                      > var nodeIndex:Number;
                      >
                      > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                      > var searchArr:Array = new Array();
                      > searchArr =
                      > String(navXML.firstChild.childNodes .attributes.search).split(",");
                      > for (j=0; j<searchArr.length; j++) {
                      > if (searchStr == searchArr[j].toLowerCase()) {
                      > nodeIndex = i;
                      > break;
                      > }
                      > }
                      > if (nodeIndex != undefined) {
                      > break;
                      > }
                      > }
                      >
                      > return navXML.firstChild.childNodes[nodeIndex];
                      > }
                      >


                      Couple things here. I am not sure what you are returning to? search_mc is
                      a MovieClip, so you are returning a Node to the onRelease? Think that may
                      be a typo.

                      As far as speed... couple things. I am not sure about actionscript and its
                      lookup times for executions like this... but, first things first.

                      You actually don't need to break up the string into other words. Thanks to
                      the indexOf method of the String Class. You can just do a test
                      if (yoursearchValue.indexOf(searchWord) > -1) {
                      found it
                      }

                      I also think you may be better served parsing your XML into a native Flash
                      Datatype like an Array of Object like this:
                      myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                      keywords:"two,2"}]

                      To build that Array you could do the loop like listed in the previous reply.
                      Then when you do your search you would just loop this array of objects
                      checking for the indexOf on the keywords property.

                      I also think it depends on how much data you are going to be handling here.
                      The parsing into the myFinisedObject gets better the more stuff you give it
                      I think (again I am not sure how fast it is in comparison - but if you try
                      it, let me know)



                      • 8. Re: Making a &quot;search&quot; box...
                        Level 7

                        "TimSymons" <webforumsuser@macromedia.com> wrote in message
                        news:efjpj9$fhk$1@forums.macromedia.com...
                        >I did not test this but you could start with something like this and
                        >probably
                        > optimize it for speed.
                        >
                        >
                        >
                        > Tim
                        >
                        >
                        >
                        >
                        > // search_txt, search_mc already exist on timeline
                        > //
                        > // assume also that the following XML data was read/parsed into the navXML
                        > variable:
                        > /*
                        > <?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>
                        > */
                        >
                        > search_mc.onRelease = searchXML;
                        >
                        > function searchXML():XMLNode {
                        > var searchStr:String = search_txt.text.toLowerCase();
                        > var i:Number;
                        > var j:Number;
                        > var nodeIndex:Number;
                        >
                        > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                        > var searchArr:Array = new Array();
                        > searchArr =
                        > String(navXML.firstChild.childNodes .attributes.search).split(",");
                        > for (j=0; j<searchArr.length; j++) {
                        > if (searchStr == searchArr[j].toLowerCase()) {
                        > nodeIndex = i;
                        > break;
                        > }
                        > }
                        > if (nodeIndex != undefined) {
                        > break;
                        > }
                        > }
                        >
                        > return navXML.firstChild.childNodes[nodeIndex];
                        > }
                        >


                        Couple things here. I am not sure what you are returning to? search_mc is
                        a MovieClip, so you are returning a Node to the onRelease? Think that may
                        be a typo.

                        As far as speed... couple things. I am not sure about actionscript and its
                        lookup times for executions like this... but, first things first.

                        You actually don't need to break up the string into other words. Thanks to
                        the indexOf method of the String Class. You can just do a test
                        if (yoursearchValue.indexOf(searchWord) > -1) {
                        found it
                        }

                        I also think you may be better served parsing your XML into a native Flash
                        Datatype like an Array of Object like this:
                        myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                        keywords:"two,2"}]

                        To build that Array you could do the loop like listed in the previous reply.
                        Then when you do your search you would just loop this array of objects
                        checking for the indexOf on the keywords property.

                        I also think it depends on how much data you are going to be handling here.
                        The parsing into the myFinisedObject gets better the more stuff you give it
                        I think (again I am not sure how fast it is in comparison - but if you try
                        it, let me know)



                        • 9. Re: Making a &quot;search&quot; box...
                          Level 7

                          "TimSymons" <webforumsuser@macromedia.com> wrote in message
                          news:efjpj9$fhk$1@forums.macromedia.com...
                          >I did not test this but you could start with something like this and
                          >probably
                          > optimize it for speed.
                          >
                          >
                          >
                          > Tim
                          >
                          >
                          >
                          >
                          > // search_txt, search_mc already exist on timeline
                          > //
                          > // assume also that the following XML data was read/parsed into the navXML
                          > variable:
                          > /*
                          > <?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>
                          > */
                          >
                          > search_mc.onRelease = searchXML;
                          >
                          > function searchXML():XMLNode {
                          > var searchStr:String = search_txt.text.toLowerCase();
                          > var i:Number;
                          > var j:Number;
                          > var nodeIndex:Number;
                          >
                          > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                          > var searchArr:Array = new Array();
                          > searchArr =
                          > String(navXML.firstChild.childNodes .attributes.search).split(",");
                          > for (j=0; j<searchArr.length; j++) {
                          > if (searchStr == searchArr[j].toLowerCase()) {
                          > nodeIndex = i;
                          > break;
                          > }
                          > }
                          > if (nodeIndex != undefined) {
                          > break;
                          > }
                          > }
                          >
                          > return navXML.firstChild.childNodes[nodeIndex];
                          > }
                          >


                          Couple things here. I am not sure what you are returning to? search_mc is
                          a MovieClip, so you are returning a Node to the onRelease? Think that may
                          be a typo.

                          As far as speed... couple things. I am not sure about actionscript and its
                          lookup times for executions like this... but, first things first.

                          You actually don't need to break up the string into other words. Thanks to
                          the indexOf method of the String Class. You can just do a test
                          if (yoursearchValue.indexOf(searchWord) > -1) {
                          found it
                          }

                          I also think you may be better served parsing your XML into a native Flash
                          Datatype like an Array of Object like this:
                          myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                          keywords:"two,2"}]

                          To build that Array you could do the loop like listed in the previous reply.
                          Then when you do your search you would just loop this array of objects
                          checking for the indexOf on the keywords property.

                          I also think it depends on how much data you are going to be handling here.
                          The parsing into the myFinisedObject gets better the more stuff you give it
                          I think (again I am not sure how fast it is in comparison - but if you try
                          it, let me know)



                          • 10. Making a &quot;search&quot; box...
                            TimSymons Level 1
                            Yea, the return object is a little strange, sorry about that part. But basically this is how I search for data on a smaller scale. Definitly not somthing with tens of thousands of entries.

                            I also have a general problem with turning the XML into another object. Why not just use the XML and XMLNode properties not to mention the XPathAPI to do what they were designed for. But I think with AS3 this become a dead issue since its will be supporting XML as a native datatype.

                            Anyway, sorry about the oops with the return value.

                            Tim

                            (By the way what was with all the post? :-)



                            • 11. Re: Making a &quot;search&quot; box...
                              Level 7

                              "TimSymons" <webforumsuser@macromedia.com> wrote in message
                              news:efjpj9$fhk$1@forums.macromedia.com...
                              >I did not test this but you could start with something like this and
                              >probably
                              > optimize it for speed.
                              >
                              >
                              >
                              > Tim
                              >
                              >
                              >
                              >
                              > // search_txt, search_mc already exist on timeline
                              > //
                              > // assume also that the following XML data was read/parsed into the navXML
                              > variable:
                              > /*
                              > <?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>
                              > */
                              >
                              > search_mc.onRelease = searchXML;
                              >
                              > function searchXML():XMLNode {
                              > var searchStr:String = search_txt.text.toLowerCase();
                              > var i:Number;
                              > var j:Number;
                              > var nodeIndex:Number;
                              >
                              > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                              > var searchArr:Array = new Array();
                              > searchArr =
                              > String(navXML.firstChild.childNodes .attributes.search).split(",");
                              > for (j=0; j<searchArr.length; j++) {
                              > if (searchStr == searchArr[j].toLowerCase()) {
                              > nodeIndex = i;
                              > break;
                              > }
                              > }
                              > if (nodeIndex != undefined) {
                              > break;
                              > }
                              > }
                              >
                              > return navXML.firstChild.childNodes[nodeIndex];
                              > }
                              >


                              Couple things here. I am not sure what you are returning to? search_mc is
                              a MovieClip, so you are returning a Node to the onRelease? Think that may
                              be a typo.

                              As far as speed... couple things. I am not sure about actionscript and its
                              lookup times for executions like this... but, first things first.

                              You actually don't need to break up the string into other words. Thanks to
                              the indexOf method of the String Class. You can just do a test
                              if (yoursearchValue.indexOf(searchWord) > -1) {
                              found it
                              }

                              I also think you may be better served parsing your XML into a native Flash
                              Datatype like an Array of Object like this:
                              myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                              keywords:"two,2"}]

                              To build that Array you could do the loop like listed in the previous reply.
                              Then when you do your search you would just loop this array of objects
                              checking for the indexOf on the keywords property.

                              I also think it depends on how much data you are going to be handling here.
                              The parsing into the myFinisedObject gets better the more stuff you give it
                              I think (again I am not sure how fast it is in comparison - but if you try
                              it, let me know)



                              • 12. Re: Making a &quot;search&quot; box...
                                Level 7

                                "TimSymons" <webforumsuser@macromedia.com> wrote in message
                                news:efjpj9$fhk$1@forums.macromedia.com...
                                >I did not test this but you could start with something like this and
                                >probably
                                > optimize it for speed.
                                >
                                >
                                >
                                > Tim
                                >
                                >
                                >
                                >
                                > // search_txt, search_mc already exist on timeline
                                > //
                                > // assume also that the following XML data was read/parsed into the navXML
                                > variable:
                                > /*
                                > <?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>
                                > */
                                >
                                > search_mc.onRelease = searchXML;
                                >
                                > function searchXML():XMLNode {
                                > var searchStr:String = search_txt.text.toLowerCase();
                                > var i:Number;
                                > var j:Number;
                                > var nodeIndex:Number;
                                >
                                > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                                > var searchArr:Array = new Array();
                                > searchArr =
                                > String(navXML.firstChild.childNodes .attributes.search).split(",");
                                > for (j=0; j<searchArr.length; j++) {
                                > if (searchStr == searchArr[j].toLowerCase()) {
                                > nodeIndex = i;
                                > break;
                                > }
                                > }
                                > if (nodeIndex != undefined) {
                                > break;
                                > }
                                > }
                                >
                                > return navXML.firstChild.childNodes[nodeIndex];
                                > }
                                >


                                Couple things here. I am not sure what you are returning to? search_mc is
                                a MovieClip, so you are returning a Node to the onRelease? Think that may
                                be a typo.

                                As far as speed... couple things. I am not sure about actionscript and its
                                lookup times for executions like this... but, first things first.

                                You actually don't need to break up the string into other words. Thanks to
                                the indexOf method of the String Class. You can just do a test
                                if (yoursearchValue.indexOf(searchWord) > -1) {
                                found it
                                }

                                I also think you may be better served parsing your XML into a native Flash
                                Datatype like an Array of Object like this:
                                myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                                keywords:"two,2"}]

                                To build that Array you could do the loop like listed in the previous reply.
                                Then when you do your search you would just loop this array of objects
                                checking for the indexOf on the keywords property.

                                I also think it depends on how much data you are going to be handling here.
                                The parsing into the myFinisedObject gets better the more stuff you give it
                                I think (again I am not sure how fast it is in comparison - but if you try
                                it, let me know)



                                • 13. Re: Making a &quot;search&quot; box...
                                  Level 7

                                  "TimSymons" <webforumsuser@macromedia.com> wrote in message
                                  news:efjpj9$fhk$1@forums.macromedia.com...
                                  >I did not test this but you could start with something like this and
                                  >probably
                                  > optimize it for speed.
                                  >
                                  >
                                  >
                                  > Tim
                                  >
                                  >
                                  >
                                  >
                                  > // search_txt, search_mc already exist on timeline
                                  > //
                                  > // assume also that the following XML data was read/parsed into the navXML
                                  > variable:
                                  > /*
                                  > <?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>
                                  > */
                                  >
                                  > search_mc.onRelease = searchXML;
                                  >
                                  > function searchXML():XMLNode {
                                  > var searchStr:String = search_txt.text.toLowerCase();
                                  > var i:Number;
                                  > var j:Number;
                                  > var nodeIndex:Number;
                                  >
                                  > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                                  > var searchArr:Array = new Array();
                                  > searchArr =
                                  > String(navXML.firstChild.childNodes .attributes.search).split(",");
                                  > for (j=0; j<searchArr.length; j++) {
                                  > if (searchStr == searchArr[j].toLowerCase()) {
                                  > nodeIndex = i;
                                  > break;
                                  > }
                                  > }
                                  > if (nodeIndex != undefined) {
                                  > break;
                                  > }
                                  > }
                                  >
                                  > return navXML.firstChild.childNodes[nodeIndex];
                                  > }
                                  >


                                  Couple things here. I am not sure what you are returning to? search_mc is
                                  a MovieClip, so you are returning a Node to the onRelease? Think that may
                                  be a typo.

                                  As far as speed... couple things. I am not sure about actionscript and its
                                  lookup times for executions like this... but, first things first.

                                  You actually don't need to break up the string into other words. Thanks to
                                  the indexOf method of the String Class. You can just do a test
                                  if (yoursearchValue.indexOf(searchWord) > -1) {
                                  found it
                                  }

                                  I also think you may be better served parsing your XML into a native Flash
                                  Datatype like an Array of Object like this:
                                  myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                                  keywords:"two,2"}]

                                  To build that Array you could do the loop like listed in the previous reply.
                                  Then when you do your search you would just loop this array of objects
                                  checking for the indexOf on the keywords property.

                                  I also think it depends on how much data you are going to be handling here.
                                  The parsing into the myFinisedObject gets better the more stuff you give it
                                  I think (again I am not sure how fast it is in comparison - but if you try
                                  it, let me know)



                                  • 14. Re: Making a &quot;search&quot; box...
                                    Level 7

                                    "TimSymons" <webforumsuser@macromedia.com> wrote in message
                                    news:efjpj9$fhk$1@forums.macromedia.com...
                                    >I did not test this but you could start with something like this and
                                    >probably
                                    > optimize it for speed.
                                    >
                                    >
                                    >
                                    > Tim
                                    >
                                    >
                                    >
                                    >
                                    > // search_txt, search_mc already exist on timeline
                                    > //
                                    > // assume also that the following XML data was read/parsed into the navXML
                                    > variable:
                                    > /*
                                    > <?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>
                                    > */
                                    >
                                    > search_mc.onRelease = searchXML;
                                    >
                                    > function searchXML():XMLNode {
                                    > var searchStr:String = search_txt.text.toLowerCase();
                                    > var i:Number;
                                    > var j:Number;
                                    > var nodeIndex:Number;
                                    >
                                    > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                                    > var searchArr:Array = new Array();
                                    > searchArr =
                                    > String(navXML.firstChild.childNodes .attributes.search).split(",");
                                    > for (j=0; j<searchArr.length; j++) {
                                    > if (searchStr == searchArr[j].toLowerCase()) {
                                    > nodeIndex = i;
                                    > break;
                                    > }
                                    > }
                                    > if (nodeIndex != undefined) {
                                    > break;
                                    > }
                                    > }
                                    >
                                    > return navXML.firstChild.childNodes[nodeIndex];
                                    > }
                                    >


                                    Couple things here. I am not sure what you are returning to? search_mc is
                                    a MovieClip, so you are returning a Node to the onRelease? Think that may
                                    be a typo.

                                    As far as speed... couple things. I am not sure about actionscript and its
                                    lookup times for executions like this... but, first things first.

                                    You actually don't need to break up the string into other words. Thanks to
                                    the indexOf method of the String Class. You can just do a test
                                    if (yoursearchValue.indexOf(searchWord) > -1) {
                                    found it
                                    }

                                    I also think you may be better served parsing your XML into a native Flash
                                    Datatype like an Array of Object like this:
                                    myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                                    keywords:"two,2"}]

                                    To build that Array you could do the loop like listed in the previous reply.
                                    Then when you do your search you would just loop this array of objects
                                    checking for the indexOf on the keywords property.

                                    I also think it depends on how much data you are going to be handling here.
                                    The parsing into the myFinisedObject gets better the more stuff you give it
                                    I think (again I am not sure how fast it is in comparison - but if you try
                                    it, let me know)



                                    • 15. Re: Making a &quot;search&quot; box...
                                      Level 7

                                      "TimSymons" <webforumsuser@macromedia.com> wrote in message
                                      news:efjpj9$fhk$1@forums.macromedia.com...
                                      >I did not test this but you could start with something like this and
                                      >probably
                                      > optimize it for speed.
                                      >
                                      >
                                      >
                                      > Tim
                                      >
                                      >
                                      >
                                      >
                                      > // search_txt, search_mc already exist on timeline
                                      > //
                                      > // assume also that the following XML data was read/parsed into the navXML
                                      > variable:
                                      > /*
                                      > <?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>
                                      > */
                                      >
                                      > search_mc.onRelease = searchXML;
                                      >
                                      > function searchXML():XMLNode {
                                      > var searchStr:String = search_txt.text.toLowerCase();
                                      > var i:Number;
                                      > var j:Number;
                                      > var nodeIndex:Number;
                                      >
                                      > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                                      > var searchArr:Array = new Array();
                                      > searchArr =
                                      > String(navXML.firstChild.childNodes .attributes.search).split(",");
                                      > for (j=0; j<searchArr.length; j++) {
                                      > if (searchStr == searchArr[j].toLowerCase()) {
                                      > nodeIndex = i;
                                      > break;
                                      > }
                                      > }
                                      > if (nodeIndex != undefined) {
                                      > break;
                                      > }
                                      > }
                                      >
                                      > return navXML.firstChild.childNodes[nodeIndex];
                                      > }
                                      >


                                      Couple things here. I am not sure what you are returning to? search_mc is
                                      a MovieClip, so you are returning a Node to the onRelease? Think that may
                                      be a typo.

                                      As far as speed... couple things. I am not sure about actionscript and its
                                      lookup times for executions like this... but, first things first.

                                      You actually don't need to break up the string into other words. Thanks to
                                      the indexOf method of the String Class. You can just do a test
                                      if (yoursearchValue.indexOf(searchWord) > -1) {
                                      found it
                                      }

                                      I also think you may be better served parsing your XML into a native Flash
                                      Datatype like an Array of Object like this:
                                      myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                                      keywords:"two,2"}]

                                      To build that Array you could do the loop like listed in the previous reply.
                                      Then when you do your search you would just loop this array of objects
                                      checking for the indexOf on the keywords property.

                                      I also think it depends on how much data you are going to be handling here.
                                      The parsing into the myFinisedObject gets better the more stuff you give it
                                      I think (again I am not sure how fast it is in comparison - but if you try
                                      it, let me know)



                                      • 16. Re: Making a &quot;search&quot; box...
                                        Level 7

                                        "TimSymons" <webforumsuser@macromedia.com> wrote in message
                                        news:efjpj9$fhk$1@forums.macromedia.com...
                                        >I did not test this but you could start with something like this and
                                        >probably
                                        > optimize it for speed.
                                        >
                                        >
                                        >
                                        > Tim
                                        >
                                        >
                                        >
                                        >
                                        > // search_txt, search_mc already exist on timeline
                                        > //
                                        > // assume also that the following XML data was read/parsed into the navXML
                                        > variable:
                                        > /*
                                        > <?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>
                                        > */
                                        >
                                        > search_mc.onRelease = searchXML;
                                        >
                                        > function searchXML():XMLNode {
                                        > var searchStr:String = search_txt.text.toLowerCase();
                                        > var i:Number;
                                        > var j:Number;
                                        > var nodeIndex:Number;
                                        >
                                        > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                                        > var searchArr:Array = new Array();
                                        > searchArr =
                                        > String(navXML.firstChild.childNodes .attributes.search).split(",");
                                        > for (j=0; j<searchArr.length; j++) {
                                        > if (searchStr == searchArr[j].toLowerCase()) {
                                        > nodeIndex = i;
                                        > break;
                                        > }
                                        > }
                                        > if (nodeIndex != undefined) {
                                        > break;
                                        > }
                                        > }
                                        >
                                        > return navXML.firstChild.childNodes[nodeIndex];
                                        > }
                                        >


                                        Couple things here. I am not sure what you are returning to? search_mc is
                                        a MovieClip, so you are returning a Node to the onRelease? Think that may
                                        be a typo.

                                        As far as speed... couple things. I am not sure about actionscript and its
                                        lookup times for executions like this... but, first things first.

                                        You actually don't need to break up the string into other words. Thanks to
                                        the indexOf method of the String Class. You can just do a test
                                        if (yoursearchValue.indexOf(searchWord) > -1) {
                                        found it
                                        }

                                        I also think you may be better served parsing your XML into a native Flash
                                        Datatype like an Array of Object like this:
                                        myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                                        keywords:"two,2"}]

                                        To build that Array you could do the loop like listed in the previous reply.
                                        Then when you do your search you would just loop this array of objects
                                        checking for the indexOf on the keywords property.

                                        I also think it depends on how much data you are going to be handling here.
                                        The parsing into the myFinisedObject gets better the more stuff you give it
                                        I think (again I am not sure how fast it is in comparison - but if you try
                                        it, let me know)



                                        • 17. Re: Making a &quot;search&quot; box...
                                          Level 7

                                          "TimSymons" <webforumsuser@macromedia.com> wrote in message
                                          news:efjpj9$fhk$1@forums.macromedia.com...
                                          >I did not test this but you could start with something like this and
                                          >probably
                                          > optimize it for speed.
                                          >
                                          >
                                          >
                                          > Tim
                                          >
                                          >
                                          >
                                          >
                                          > // search_txt, search_mc already exist on timeline
                                          > //
                                          > // assume also that the following XML data was read/parsed into the navXML
                                          > variable:
                                          > /*
                                          > <?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>
                                          > */
                                          >
                                          > search_mc.onRelease = searchXML;
                                          >
                                          > function searchXML():XMLNode {
                                          > var searchStr:String = search_txt.text.toLowerCase();
                                          > var i:Number;
                                          > var j:Number;
                                          > var nodeIndex:Number;
                                          >
                                          > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                                          > var searchArr:Array = new Array();
                                          > searchArr =
                                          > String(navXML.firstChild.childNodes .attributes.search).split(",");
                                          > for (j=0; j<searchArr.length; j++) {
                                          > if (searchStr == searchArr[j].toLowerCase()) {
                                          > nodeIndex = i;
                                          > break;
                                          > }
                                          > }
                                          > if (nodeIndex != undefined) {
                                          > break;
                                          > }
                                          > }
                                          >
                                          > return navXML.firstChild.childNodes[nodeIndex];
                                          > }
                                          >


                                          Couple things here. I am not sure what you are returning to? search_mc is
                                          a MovieClip, so you are returning a Node to the onRelease? Think that may
                                          be a typo.

                                          As far as speed... couple things. I am not sure about actionscript and its
                                          lookup times for executions like this... but, first things first.

                                          You actually don't need to break up the string into other words. Thanks to
                                          the indexOf method of the String Class. You can just do a test
                                          if (yoursearchValue.indexOf(searchWord) > -1) {
                                          found it
                                          }

                                          I also think you may be better served parsing your XML into a native Flash
                                          Datatype like an Array of Object like this:
                                          myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                                          keywords:"two,2"}]

                                          To build that Array you could do the loop like listed in the previous reply.
                                          Then when you do your search you would just loop this array of objects
                                          checking for the indexOf on the keywords property.

                                          I also think it depends on how much data you are going to be handling here.
                                          The parsing into the myFinisedObject gets better the more stuff you give it
                                          I think (again I am not sure how fast it is in comparison - but if you try
                                          it, let me know)



                                          • 18. Re: Making a &quot;search&quot; box...
                                            Level 7

                                            "TimSymons" <webforumsuser@macromedia.com> wrote in message
                                            news:efjpj9$fhk$1@forums.macromedia.com...
                                            >I did not test this but you could start with something like this and
                                            >probably
                                            > optimize it for speed.
                                            >
                                            >
                                            >
                                            > Tim
                                            >
                                            >
                                            >
                                            >
                                            > // search_txt, search_mc already exist on timeline
                                            > //
                                            > // assume also that the following XML data was read/parsed into the navXML
                                            > variable:
                                            > /*
                                            > <?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>
                                            > */
                                            >
                                            > search_mc.onRelease = searchXML;
                                            >
                                            > function searchXML():XMLNode {
                                            > var searchStr:String = search_txt.text.toLowerCase();
                                            > var i:Number;
                                            > var j:Number;
                                            > var nodeIndex:Number;
                                            >
                                            > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                                            > var searchArr:Array = new Array();
                                            > searchArr =
                                            > String(navXML.firstChild.childNodes .attributes.search).split(",");
                                            > for (j=0; j<searchArr.length; j++) {
                                            > if (searchStr == searchArr[j].toLowerCase()) {
                                            > nodeIndex = i;
                                            > break;
                                            > }
                                            > }
                                            > if (nodeIndex != undefined) {
                                            > break;
                                            > }
                                            > }
                                            >
                                            > return navXML.firstChild.childNodes[nodeIndex];
                                            > }
                                            >


                                            Couple things here. I am not sure what you are returning to? search_mc is
                                            a MovieClip, so you are returning a Node to the onRelease? Think that may
                                            be a typo.

                                            As far as speed... couple things. I am not sure about actionscript and its
                                            lookup times for executions like this... but, first things first.

                                            You actually don't need to break up the string into other words. Thanks to
                                            the indexOf method of the String Class. You can just do a test
                                            if (yoursearchValue.indexOf(searchWord) > -1) {
                                            found it
                                            }

                                            I also think you may be better served parsing your XML into a native Flash
                                            Datatype like an Array of Object like this:
                                            myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                                            keywords:"two,2"}]

                                            To build that Array you could do the loop like listed in the previous reply.
                                            Then when you do your search you would just loop this array of objects
                                            checking for the indexOf on the keywords property.

                                            I also think it depends on how much data you are going to be handling here.
                                            The parsing into the myFinisedObject gets better the more stuff you give it
                                            I think (again I am not sure how fast it is in comparison - but if you try
                                            it, let me know)



                                            • 19. Re: Making a &quot;search&quot; box...
                                              Level 7

                                              "TimSymons" <webforumsuser@macromedia.com> wrote in message
                                              news:efjpj9$fhk$1@forums.macromedia.com...
                                              >I did not test this but you could start with something like this and
                                              >probably
                                              > optimize it for speed.
                                              >
                                              >
                                              >
                                              > Tim
                                              >
                                              >
                                              >
                                              >
                                              > // search_txt, search_mc already exist on timeline
                                              > //
                                              > // assume also that the following XML data was read/parsed into the navXML
                                              > variable:
                                              > /*
                                              > <?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>
                                              > */
                                              >
                                              > search_mc.onRelease = searchXML;
                                              >
                                              > function searchXML():XMLNode {
                                              > var searchStr:String = search_txt.text.toLowerCase();
                                              > var i:Number;
                                              > var j:Number;
                                              > var nodeIndex:Number;
                                              >
                                              > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                                              > var searchArr:Array = new Array();
                                              > searchArr =
                                              > String(navXML.firstChild.childNodes .attributes.search).split(",");
                                              > for (j=0; j<searchArr.length; j++) {
                                              > if (searchStr == searchArr[j].toLowerCase()) {
                                              > nodeIndex = i;
                                              > break;
                                              > }
                                              > }
                                              > if (nodeIndex != undefined) {
                                              > break;
                                              > }
                                              > }
                                              >
                                              > return navXML.firstChild.childNodes[nodeIndex];
                                              > }
                                              >


                                              Couple things here. I am not sure what you are returning to? search_mc is
                                              a MovieClip, so you are returning a Node to the onRelease? Think that may
                                              be a typo.

                                              As far as speed... couple things. I am not sure about actionscript and its
                                              lookup times for executions like this... but, first things first.

                                              You actually don't need to break up the string into other words. Thanks to
                                              the indexOf method of the String Class. You can just do a test
                                              if (yoursearchValue.indexOf(searchWord) > -1) {
                                              found it
                                              }

                                              I also think you may be better served parsing your XML into a native Flash
                                              Datatype like an Array of Object like this:
                                              myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                                              keywords:"two,2"}]

                                              To build that Array you could do the loop like listed in the previous reply.
                                              Then when you do your search you would just loop this array of objects
                                              checking for the indexOf on the keywords property.

                                              I also think it depends on how much data you are going to be handling here.
                                              The parsing into the myFinisedObject gets better the more stuff you give it
                                              I think (again I am not sure how fast it is in comparison - but if you try
                                              it, let me know)



                                              • 20. Re: Making a &quot;search&quot; box...
                                                Level 7

                                                "TimSymons" <webforumsuser@macromedia.com> wrote in message
                                                news:efjpj9$fhk$1@forums.macromedia.com...
                                                >I did not test this but you could start with something like this and
                                                >probably
                                                > optimize it for speed.
                                                >
                                                >
                                                >
                                                > Tim
                                                >
                                                >
                                                >
                                                >
                                                > // search_txt, search_mc already exist on timeline
                                                > //
                                                > // assume also that the following XML data was read/parsed into the navXML
                                                > variable:
                                                > /*
                                                > <?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>
                                                > */
                                                >
                                                > search_mc.onRelease = searchXML;
                                                >
                                                > function searchXML():XMLNode {
                                                > var searchStr:String = search_txt.text.toLowerCase();
                                                > var i:Number;
                                                > var j:Number;
                                                > var nodeIndex:Number;
                                                >
                                                > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                                                > var searchArr:Array = new Array();
                                                > searchArr =
                                                > String(navXML.firstChild.childNodes .attributes.search).split(",");
                                                > for (j=0; j<searchArr.length; j++) {
                                                > if (searchStr == searchArr[j].toLowerCase()) {
                                                > nodeIndex = i;
                                                > break;
                                                > }
                                                > }
                                                > if (nodeIndex != undefined) {
                                                > break;
                                                > }
                                                > }
                                                >
                                                > return navXML.firstChild.childNodes[nodeIndex];
                                                > }
                                                >


                                                Couple things here. I am not sure what you are returning to? search_mc is
                                                a MovieClip, so you are returning a Node to the onRelease? Think that may
                                                be a typo.

                                                As far as speed... couple things. I am not sure about actionscript and its
                                                lookup times for executions like this... but, first things first.

                                                You actually don't need to break up the string into other words. Thanks to
                                                the indexOf method of the String Class. You can just do a test
                                                if (yoursearchValue.indexOf(searchWord) > -1) {
                                                found it
                                                }

                                                I also think you may be better served parsing your XML into a native Flash
                                                Datatype like an Array of Object like this:
                                                myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                                                keywords:"two,2"}]

                                                To build that Array you could do the loop like listed in the previous reply.
                                                Then when you do your search you would just loop this array of objects
                                                checking for the indexOf on the keywords property.

                                                I also think it depends on how much data you are going to be handling here.
                                                The parsing into the myFinisedObject gets better the more stuff you give it
                                                I think (again I am not sure how fast it is in comparison - but if you try
                                                it, let me know)



                                                • 21. Re: Making a &quot;search&quot; box...
                                                  Level 7

                                                  "TimSymons" <webforumsuser@macromedia.com> wrote in message
                                                  news:efjpj9$fhk$1@forums.macromedia.com...
                                                  >I did not test this but you could start with something like this and
                                                  >probably
                                                  > optimize it for speed.
                                                  >
                                                  >
                                                  >
                                                  > Tim
                                                  >
                                                  >
                                                  >
                                                  >
                                                  > // search_txt, search_mc already exist on timeline
                                                  > //
                                                  > // assume also that the following XML data was read/parsed into the navXML
                                                  > variable:
                                                  > /*
                                                  > <?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>
                                                  > */
                                                  >
                                                  > search_mc.onRelease = searchXML;
                                                  >
                                                  > function searchXML():XMLNode {
                                                  > var searchStr:String = search_txt.text.toLowerCase();
                                                  > var i:Number;
                                                  > var j:Number;
                                                  > var nodeIndex:Number;
                                                  >
                                                  > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                                                  > var searchArr:Array = new Array();
                                                  > searchArr =
                                                  > String(navXML.firstChild.childNodes .attributes.search).split(",");
                                                  > for (j=0; j<searchArr.length; j++) {
                                                  > if (searchStr == searchArr[j].toLowerCase()) {
                                                  > nodeIndex = i;
                                                  > break;
                                                  > }
                                                  > }
                                                  > if (nodeIndex != undefined) {
                                                  > break;
                                                  > }
                                                  > }
                                                  >
                                                  > return navXML.firstChild.childNodes[nodeIndex];
                                                  > }
                                                  >


                                                  Couple things here. I am not sure what you are returning to? search_mc is
                                                  a MovieClip, so you are returning a Node to the onRelease? Think that may
                                                  be a typo.

                                                  As far as speed... couple things. I am not sure about actionscript and its
                                                  lookup times for executions like this... but, first things first.

                                                  You actually don't need to break up the string into other words. Thanks to
                                                  the indexOf method of the String Class. You can just do a test
                                                  if (yoursearchValue.indexOf(searchWord) > -1) {
                                                  found it
                                                  }

                                                  I also think you may be better served parsing your XML into a native Flash
                                                  Datatype like an Array of Object like this:
                                                  myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                                                  keywords:"two,2"}]

                                                  To build that Array you could do the loop like listed in the previous reply.
                                                  Then when you do your search you would just loop this array of objects
                                                  checking for the indexOf on the keywords property.

                                                  I also think it depends on how much data you are going to be handling here.
                                                  The parsing into the myFinisedObject gets better the more stuff you give it
                                                  I think (again I am not sure how fast it is in comparison - but if you try
                                                  it, let me know)



                                                  • 22. Re: Making a &quot;search&quot; box...
                                                    Level 7

                                                    "TimSymons" <webforumsuser@macromedia.com> wrote in message
                                                    news:efjpj9$fhk$1@forums.macromedia.com...
                                                    >I did not test this but you could start with something like this and
                                                    >probably
                                                    > optimize it for speed.
                                                    >
                                                    >
                                                    >
                                                    > Tim
                                                    >
                                                    >
                                                    >
                                                    >
                                                    > // search_txt, search_mc already exist on timeline
                                                    > //
                                                    > // assume also that the following XML data was read/parsed into the navXML
                                                    > variable:
                                                    > /*
                                                    > <?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>
                                                    > */
                                                    >
                                                    > search_mc.onRelease = searchXML;
                                                    >
                                                    > function searchXML():XMLNode {
                                                    > var searchStr:String = search_txt.text.toLowerCase();
                                                    > var i:Number;
                                                    > var j:Number;
                                                    > var nodeIndex:Number;
                                                    >
                                                    > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                                                    > var searchArr:Array = new Array();
                                                    > searchArr =
                                                    > String(navXML.firstChild.childNodes .attributes.search).split(",");
                                                    > for (j=0; j<searchArr.length; j++) {
                                                    > if (searchStr == searchArr[j].toLowerCase()) {
                                                    > nodeIndex = i;
                                                    > break;
                                                    > }
                                                    > }
                                                    > if (nodeIndex != undefined) {
                                                    > break;
                                                    > }
                                                    > }
                                                    >
                                                    > return navXML.firstChild.childNodes[nodeIndex];
                                                    > }
                                                    >


                                                    Couple things here. I am not sure what you are returning to? search_mc is
                                                    a MovieClip, so you are returning a Node to the onRelease? Think that may
                                                    be a typo.

                                                    As far as speed... couple things. I am not sure about actionscript and its
                                                    lookup times for executions like this... but, first things first.

                                                    You actually don't need to break up the string into other words. Thanks to
                                                    the indexOf method of the String Class. You can just do a test
                                                    if (yoursearchValue.indexOf(searchWord) > -1) {
                                                    found it
                                                    }

                                                    I also think you may be better served parsing your XML into a native Flash
                                                    Datatype like an Array of Object like this:
                                                    myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                                                    keywords:"two,2"}]

                                                    To build that Array you could do the loop like listed in the previous reply.
                                                    Then when you do your search you would just loop this array of objects
                                                    checking for the indexOf on the keywords property.

                                                    I also think it depends on how much data you are going to be handling here.
                                                    The parsing into the myFinisedObject gets better the more stuff you give it
                                                    I think (again I am not sure how fast it is in comparison - but if you try
                                                    it, let me know)



                                                    • 23. Re: Making a &quot;search&quot; box...
                                                      Level 7

                                                      "TimSymons" <webforumsuser@macromedia.com> wrote in message
                                                      news:efjpj9$fhk$1@forums.macromedia.com...
                                                      >I did not test this but you could start with something like this and
                                                      >probably
                                                      > optimize it for speed.
                                                      >
                                                      >
                                                      >
                                                      > Tim
                                                      >
                                                      >
                                                      >
                                                      >
                                                      > // search_txt, search_mc already exist on timeline
                                                      > //
                                                      > // assume also that the following XML data was read/parsed into the navXML
                                                      > variable:
                                                      > /*
                                                      > <?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>
                                                      > */
                                                      >
                                                      > search_mc.onRelease = searchXML;
                                                      >
                                                      > function searchXML():XMLNode {
                                                      > var searchStr:String = search_txt.text.toLowerCase();
                                                      > var i:Number;
                                                      > var j:Number;
                                                      > var nodeIndex:Number;
                                                      >
                                                      > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                                                      > var searchArr:Array = new Array();
                                                      > searchArr =
                                                      > String(navXML.firstChild.childNodes .attributes.search).split(",");
                                                      > for (j=0; j<searchArr.length; j++) {
                                                      > if (searchStr == searchArr[j].toLowerCase()) {
                                                      > nodeIndex = i;
                                                      > break;
                                                      > }
                                                      > }
                                                      > if (nodeIndex != undefined) {
                                                      > break;
                                                      > }
                                                      > }
                                                      >
                                                      > return navXML.firstChild.childNodes[nodeIndex];
                                                      > }
                                                      >


                                                      Couple things here. I am not sure what you are returning to? search_mc is
                                                      a MovieClip, so you are returning a Node to the onRelease? Think that may
                                                      be a typo.

                                                      As far as speed... couple things. I am not sure about actionscript and its
                                                      lookup times for executions like this... but, first things first.

                                                      You actually don't need to break up the string into other words. Thanks to
                                                      the indexOf method of the String Class. You can just do a test
                                                      if (yoursearchValue.indexOf(searchWord) > -1) {
                                                      found it
                                                      }

                                                      I also think you may be better served parsing your XML into a native Flash
                                                      Datatype like an Array of Object like this:
                                                      myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                                                      keywords:"two,2"}]

                                                      To build that Array you could do the loop like listed in the previous reply.
                                                      Then when you do your search you would just loop this array of objects
                                                      checking for the indexOf on the keywords property.

                                                      I also think it depends on how much data you are going to be handling here.
                                                      The parsing into the myFinisedObject gets better the more stuff you give it
                                                      I think (again I am not sure how fast it is in comparison - but if you try
                                                      it, let me know)



                                                      • 24. Re: Making a &quot;search&quot; box...
                                                        Level 7

                                                        "TimSymons" <webforumsuser@macromedia.com> wrote in message
                                                        news:efjpj9$fhk$1@forums.macromedia.com...
                                                        >I did not test this but you could start with something like this and
                                                        >probably
                                                        > optimize it for speed.
                                                        >
                                                        >
                                                        >
                                                        > Tim
                                                        >
                                                        >
                                                        >
                                                        >
                                                        > // search_txt, search_mc already exist on timeline
                                                        > //
                                                        > // assume also that the following XML data was read/parsed into the navXML
                                                        > variable:
                                                        > /*
                                                        > <?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>
                                                        > */
                                                        >
                                                        > search_mc.onRelease = searchXML;
                                                        >
                                                        > function searchXML():XMLNode {
                                                        > var searchStr:String = search_txt.text.toLowerCase();
                                                        > var i:Number;
                                                        > var j:Number;
                                                        > var nodeIndex:Number;
                                                        >
                                                        > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                                                        > var searchArr:Array = new Array();
                                                        > searchArr =
                                                        > String(navXML.firstChild.childNodes .attributes.search).split(",");
                                                        > for (j=0; j<searchArr.length; j++) {
                                                        > if (searchStr == searchArr[j].toLowerCase()) {
                                                        > nodeIndex = i;
                                                        > break;
                                                        > }
                                                        > }
                                                        > if (nodeIndex != undefined) {
                                                        > break;
                                                        > }
                                                        > }
                                                        >
                                                        > return navXML.firstChild.childNodes[nodeIndex];
                                                        > }
                                                        >


                                                        Couple things here. I am not sure what you are returning to? search_mc is
                                                        a MovieClip, so you are returning a Node to the onRelease? Think that may
                                                        be a typo.

                                                        As far as speed... couple things. I am not sure about actionscript and its
                                                        lookup times for executions like this... but, first things first.

                                                        You actually don't need to break up the string into other words. Thanks to
                                                        the indexOf method of the String Class. You can just do a test
                                                        if (yoursearchValue.indexOf(searchWord) > -1) {
                                                        found it
                                                        }

                                                        I also think you may be better served parsing your XML into a native Flash
                                                        Datatype like an Array of Object like this:
                                                        myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                                                        keywords:"two,2"}]

                                                        To build that Array you could do the loop like listed in the previous reply.
                                                        Then when you do your search you would just loop this array of objects
                                                        checking for the indexOf on the keywords property.

                                                        I also think it depends on how much data you are going to be handling here.
                                                        The parsing into the myFinisedObject gets better the more stuff you give it
                                                        I think (again I am not sure how fast it is in comparison - but if you try
                                                        it, let me know)



                                                        • 25. Re: Making a &quot;search&quot; box...
                                                          Level 7

                                                          "TimSymons" <webforumsuser@macromedia.com> wrote in message
                                                          news:efjpj9$fhk$1@forums.macromedia.com...
                                                          >I did not test this but you could start with something like this and
                                                          >probably
                                                          > optimize it for speed.
                                                          >
                                                          >
                                                          >
                                                          > Tim
                                                          >
                                                          >
                                                          >
                                                          >
                                                          > // search_txt, search_mc already exist on timeline
                                                          > //
                                                          > // assume also that the following XML data was read/parsed into the navXML
                                                          > variable:
                                                          > /*
                                                          > <?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>
                                                          > */
                                                          >
                                                          > search_mc.onRelease = searchXML;
                                                          >
                                                          > function searchXML():XMLNode {
                                                          > var searchStr:String = search_txt.text.toLowerCase();
                                                          > var i:Number;
                                                          > var j:Number;
                                                          > var nodeIndex:Number;
                                                          >
                                                          > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                                                          > var searchArr:Array = new Array();
                                                          > searchArr =
                                                          > String(navXML.firstChild.childNodes .attributes.search).split(",");
                                                          > for (j=0; j<searchArr.length; j++) {
                                                          > if (searchStr == searchArr[j].toLowerCase()) {
                                                          > nodeIndex = i;
                                                          > break;
                                                          > }
                                                          > }
                                                          > if (nodeIndex != undefined) {
                                                          > break;
                                                          > }
                                                          > }
                                                          >
                                                          > return navXML.firstChild.childNodes[nodeIndex];
                                                          > }
                                                          >


                                                          Couple things here. I am not sure what you are returning to? search_mc is
                                                          a MovieClip, so you are returning a Node to the onRelease? Think that may
                                                          be a typo.

                                                          As far as speed... couple things. I am not sure about actionscript and its
                                                          lookup times for executions like this... but, first things first.

                                                          You actually don't need to break up the string into other words. Thanks to
                                                          the indexOf method of the String Class. You can just do a test
                                                          if (yoursearchValue.indexOf(searchWord) > -1) {
                                                          found it
                                                          }

                                                          I also think you may be better served parsing your XML into a native Flash
                                                          Datatype like an Array of Object like this:
                                                          myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                                                          keywords:"two,2"}]

                                                          To build that Array you could do the loop like listed in the previous reply.
                                                          Then when you do your search you would just loop this array of objects
                                                          checking for the indexOf on the keywords property.

                                                          I also think it depends on how much data you are going to be handling here.
                                                          The parsing into the myFinisedObject gets better the more stuff you give it
                                                          I think (again I am not sure how fast it is in comparison - but if you try
                                                          it, let me know)



                                                          • 26. Re: Making a &quot;search&quot; box...
                                                            Level 7

                                                            "TimSymons" <webforumsuser@macromedia.com> wrote in message
                                                            news:efjpj9$fhk$1@forums.macromedia.com...
                                                            >I did not test this but you could start with something like this and
                                                            >probably
                                                            > optimize it for speed.
                                                            >
                                                            >
                                                            >
                                                            > Tim
                                                            >
                                                            >
                                                            >
                                                            >
                                                            > // search_txt, search_mc already exist on timeline
                                                            > //
                                                            > // assume also that the following XML data was read/parsed into the navXML
                                                            > variable:
                                                            > /*
                                                            > <?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>
                                                            > */
                                                            >
                                                            > search_mc.onRelease = searchXML;
                                                            >
                                                            > function searchXML():XMLNode {
                                                            > var searchStr:String = search_txt.text.toLowerCase();
                                                            > var i:Number;
                                                            > var j:Number;
                                                            > var nodeIndex:Number;
                                                            >
                                                            > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                                                            > var searchArr:Array = new Array();
                                                            > searchArr =
                                                            > String(navXML.firstChild.childNodes .attributes.search).split(",");
                                                            > for (j=0; j<searchArr.length; j++) {
                                                            > if (searchStr == searchArr[j].toLowerCase()) {
                                                            > nodeIndex = i;
                                                            > break;
                                                            > }
                                                            > }
                                                            > if (nodeIndex != undefined) {
                                                            > break;
                                                            > }
                                                            > }
                                                            >
                                                            > return navXML.firstChild.childNodes[nodeIndex];
                                                            > }
                                                            >


                                                            Couple things here. I am not sure what you are returning to? search_mc is
                                                            a MovieClip, so you are returning a Node to the onRelease? Think that may
                                                            be a typo.

                                                            As far as speed... couple things. I am not sure about actionscript and its
                                                            lookup times for executions like this... but, first things first.

                                                            You actually don't need to break up the string into other words. Thanks to
                                                            the indexOf method of the String Class. You can just do a test
                                                            if (yoursearchValue.indexOf(searchWord) > -1) {
                                                            found it
                                                            }

                                                            I also think you may be better served parsing your XML into a native Flash
                                                            Datatype like an Array of Object like this:
                                                            myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                                                            keywords:"two,2"}]

                                                            To build that Array you could do the loop like listed in the previous reply.
                                                            Then when you do your search you would just loop this array of objects
                                                            checking for the indexOf on the keywords property.

                                                            I also think it depends on how much data you are going to be handling here.
                                                            The parsing into the myFinisedObject gets better the more stuff you give it
                                                            I think (again I am not sure how fast it is in comparison - but if you try
                                                            it, let me know)



                                                            • 27. Re: Making a &quot;search&quot; box...
                                                              Level 7

                                                              "TimSymons" <webforumsuser@macromedia.com> wrote in message
                                                              news:efjpj9$fhk$1@forums.macromedia.com...
                                                              >I did not test this but you could start with something like this and
                                                              >probably
                                                              > optimize it for speed.
                                                              >
                                                              >
                                                              >
                                                              > Tim
                                                              >
                                                              >
                                                              >
                                                              >
                                                              > // search_txt, search_mc already exist on timeline
                                                              > //
                                                              > // assume also that the following XML data was read/parsed into the navXML
                                                              > variable:
                                                              > /*
                                                              > <?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>
                                                              > */
                                                              >
                                                              > search_mc.onRelease = searchXML;
                                                              >
                                                              > function searchXML():XMLNode {
                                                              > var searchStr:String = search_txt.text.toLowerCase();
                                                              > var i:Number;
                                                              > var j:Number;
                                                              > var nodeIndex:Number;
                                                              >
                                                              > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                                                              > var searchArr:Array = new Array();
                                                              > searchArr =
                                                              > String(navXML.firstChild.childNodes .attributes.search).split(",");
                                                              > for (j=0; j<searchArr.length; j++) {
                                                              > if (searchStr == searchArr[j].toLowerCase()) {
                                                              > nodeIndex = i;
                                                              > break;
                                                              > }
                                                              > }
                                                              > if (nodeIndex != undefined) {
                                                              > break;
                                                              > }
                                                              > }
                                                              >
                                                              > return navXML.firstChild.childNodes[nodeIndex];
                                                              > }
                                                              >


                                                              Couple things here. I am not sure what you are returning to? search_mc is
                                                              a MovieClip, so you are returning a Node to the onRelease? Think that may
                                                              be a typo.

                                                              As far as speed... couple things. I am not sure about actionscript and its
                                                              lookup times for executions like this... but, first things first.

                                                              You actually don't need to break up the string into other words. Thanks to
                                                              the indexOf method of the String Class. You can just do a test
                                                              if (yoursearchValue.indexOf(searchWord) > -1) {
                                                              found it
                                                              }

                                                              I also think you may be better served parsing your XML into a native Flash
                                                              Datatype like an Array of Object like this:
                                                              myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                                                              keywords:"two,2"}]

                                                              To build that Array you could do the loop like listed in the previous reply.
                                                              Then when you do your search you would just loop this array of objects
                                                              checking for the indexOf on the keywords property.

                                                              I also think it depends on how much data you are going to be handling here.
                                                              The parsing into the myFinisedObject gets better the more stuff you give it
                                                              I think (again I am not sure how fast it is in comparison - but if you try
                                                              it, let me know)



                                                              • 28. Re: Making a &quot;search&quot; box...
                                                                Level 7

                                                                "TimSymons" <webforumsuser@macromedia.com> wrote in message
                                                                news:efjpj9$fhk$1@forums.macromedia.com...
                                                                >I did not test this but you could start with something like this and
                                                                >probably
                                                                > optimize it for speed.
                                                                >
                                                                >
                                                                >
                                                                > Tim
                                                                >
                                                                >
                                                                >
                                                                >
                                                                > // search_txt, search_mc already exist on timeline
                                                                > //
                                                                > // assume also that the following XML data was read/parsed into the navXML
                                                                > variable:
                                                                > /*
                                                                > <?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>
                                                                > */
                                                                >
                                                                > search_mc.onRelease = searchXML;
                                                                >
                                                                > function searchXML():XMLNode {
                                                                > var searchStr:String = search_txt.text.toLowerCase();
                                                                > var i:Number;
                                                                > var j:Number;
                                                                > var nodeIndex:Number;
                                                                >
                                                                > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                                                                > var searchArr:Array = new Array();
                                                                > searchArr =
                                                                > String(navXML.firstChild.childNodes .attributes.search).split(",");
                                                                > for (j=0; j<searchArr.length; j++) {
                                                                > if (searchStr == searchArr[j].toLowerCase()) {
                                                                > nodeIndex = i;
                                                                > break;
                                                                > }
                                                                > }
                                                                > if (nodeIndex != undefined) {
                                                                > break;
                                                                > }
                                                                > }
                                                                >
                                                                > return navXML.firstChild.childNodes[nodeIndex];
                                                                > }
                                                                >


                                                                Couple things here. I am not sure what you are returning to? search_mc is
                                                                a MovieClip, so you are returning a Node to the onRelease? Think that may
                                                                be a typo.

                                                                As far as speed... couple things. I am not sure about actionscript and its
                                                                lookup times for executions like this... but, first things first.

                                                                You actually don't need to break up the string into other words. Thanks to
                                                                the indexOf method of the String Class. You can just do a test
                                                                if (yoursearchValue.indexOf(searchWord) > -1) {
                                                                found it
                                                                }

                                                                I also think you may be better served parsing your XML into a native Flash
                                                                Datatype like an Array of Object like this:
                                                                myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                                                                keywords:"two,2"}]

                                                                To build that Array you could do the loop like listed in the previous reply.
                                                                Then when you do your search you would just loop this array of objects
                                                                checking for the indexOf on the keywords property.

                                                                I also think it depends on how much data you are going to be handling here.
                                                                The parsing into the myFinisedObject gets better the more stuff you give it
                                                                I think (again I am not sure how fast it is in comparison - but if you try
                                                                it, let me know)



                                                                • 29. Re: Making a &quot;search&quot; box...
                                                                  Level 7

                                                                  "TimSymons" <webforumsuser@macromedia.com> wrote in message
                                                                  news:efjpj9$fhk$1@forums.macromedia.com...
                                                                  >I did not test this but you could start with something like this and
                                                                  >probably
                                                                  > optimize it for speed.
                                                                  >
                                                                  >
                                                                  >
                                                                  > Tim
                                                                  >
                                                                  >
                                                                  >
                                                                  >
                                                                  > // search_txt, search_mc already exist on timeline
                                                                  > //
                                                                  > // assume also that the following XML data was read/parsed into the navXML
                                                                  > variable:
                                                                  > /*
                                                                  > <?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>
                                                                  > */
                                                                  >
                                                                  > search_mc.onRelease = searchXML;
                                                                  >
                                                                  > function searchXML():XMLNode {
                                                                  > var searchStr:String = search_txt.text.toLowerCase();
                                                                  > var i:Number;
                                                                  > var j:Number;
                                                                  > var nodeIndex:Number;
                                                                  >
                                                                  > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                                                                  > var searchArr:Array = new Array();
                                                                  > searchArr =
                                                                  > String(navXML.firstChild.childNodes .attributes.search).split(",");
                                                                  > for (j=0; j<searchArr.length; j++) {
                                                                  > if (searchStr == searchArr[j].toLowerCase()) {
                                                                  > nodeIndex = i;
                                                                  > break;
                                                                  > }
                                                                  > }
                                                                  > if (nodeIndex != undefined) {
                                                                  > break;
                                                                  > }
                                                                  > }
                                                                  >
                                                                  > return navXML.firstChild.childNodes[nodeIndex];
                                                                  > }
                                                                  >


                                                                  Couple things here. I am not sure what you are returning to? search_mc is
                                                                  a MovieClip, so you are returning a Node to the onRelease? Think that may
                                                                  be a typo.

                                                                  As far as speed... couple things. I am not sure about actionscript and its
                                                                  lookup times for executions like this... but, first things first.

                                                                  You actually don't need to break up the string into other words. Thanks to
                                                                  the indexOf method of the String Class. You can just do a test
                                                                  if (yoursearchValue.indexOf(searchWord) > -1) {
                                                                  found it
                                                                  }

                                                                  I also think you may be better served parsing your XML into a native Flash
                                                                  Datatype like an Array of Object like this:
                                                                  myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                                                                  keywords:"two,2"}]

                                                                  To build that Array you could do the loop like listed in the previous reply.
                                                                  Then when you do your search you would just loop this array of objects
                                                                  checking for the indexOf on the keywords property.

                                                                  I also think it depends on how much data you are going to be handling here.
                                                                  The parsing into the myFinisedObject gets better the more stuff you give it
                                                                  I think (again I am not sure how fast it is in comparison - but if you try
                                                                  it, let me know)



                                                                  • 30. Re: Making a &quot;search&quot; box...
                                                                    Level 7

                                                                    "TimSymons" <webforumsuser@macromedia.com> wrote in message
                                                                    news:efjpj9$fhk$1@forums.macromedia.com...
                                                                    >I did not test this but you could start with something like this and
                                                                    >probably
                                                                    > optimize it for speed.
                                                                    >
                                                                    >
                                                                    >
                                                                    > Tim
                                                                    >
                                                                    >
                                                                    >
                                                                    >
                                                                    > // search_txt, search_mc already exist on timeline
                                                                    > //
                                                                    > // assume also that the following XML data was read/parsed into the navXML
                                                                    > variable:
                                                                    > /*
                                                                    > <?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>
                                                                    > */
                                                                    >
                                                                    > search_mc.onRelease = searchXML;
                                                                    >
                                                                    > function searchXML():XMLNode {
                                                                    > var searchStr:String = search_txt.text.toLowerCase();
                                                                    > var i:Number;
                                                                    > var j:Number;
                                                                    > var nodeIndex:Number;
                                                                    >
                                                                    > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                                                                    > var searchArr:Array = new Array();
                                                                    > searchArr =
                                                                    > String(navXML.firstChild.childNodes .attributes.search).split(",");
                                                                    > for (j=0; j<searchArr.length; j++) {
                                                                    > if (searchStr == searchArr[j].toLowerCase()) {
                                                                    > nodeIndex = i;
                                                                    > break;
                                                                    > }
                                                                    > }
                                                                    > if (nodeIndex != undefined) {
                                                                    > break;
                                                                    > }
                                                                    > }
                                                                    >
                                                                    > return navXML.firstChild.childNodes[nodeIndex];
                                                                    > }
                                                                    >


                                                                    Couple things here. I am not sure what you are returning to? search_mc is
                                                                    a MovieClip, so you are returning a Node to the onRelease? Think that may
                                                                    be a typo.

                                                                    As far as speed... couple things. I am not sure about actionscript and its
                                                                    lookup times for executions like this... but, first things first.

                                                                    You actually don't need to break up the string into other words. Thanks to
                                                                    the indexOf method of the String Class. You can just do a test
                                                                    if (yoursearchValue.indexOf(searchWord) > -1) {
                                                                    found it
                                                                    }

                                                                    I also think you may be better served parsing your XML into a native Flash
                                                                    Datatype like an Array of Object like this:
                                                                    myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                                                                    keywords:"two,2"}]

                                                                    To build that Array you could do the loop like listed in the previous reply.
                                                                    Then when you do your search you would just loop this array of objects
                                                                    checking for the indexOf on the keywords property.

                                                                    I also think it depends on how much data you are going to be handling here.
                                                                    The parsing into the myFinisedObject gets better the more stuff you give it
                                                                    I think (again I am not sure how fast it is in comparison - but if you try
                                                                    it, let me know)



                                                                    • 31. Re: Making a &quot;search&quot; box...
                                                                      Level 7

                                                                      "TimSymons" <webforumsuser@macromedia.com> wrote in message
                                                                      news:efjpj9$fhk$1@forums.macromedia.com...
                                                                      >I did not test this but you could start with something like this and
                                                                      >probably
                                                                      > optimize it for speed.
                                                                      >
                                                                      >
                                                                      >
                                                                      > Tim
                                                                      >
                                                                      >
                                                                      >
                                                                      >
                                                                      > // search_txt, search_mc already exist on timeline
                                                                      > //
                                                                      > // assume also that the following XML data was read/parsed into the navXML
                                                                      > variable:
                                                                      > /*
                                                                      > <?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>
                                                                      > */
                                                                      >
                                                                      > search_mc.onRelease = searchXML;
                                                                      >
                                                                      > function searchXML():XMLNode {
                                                                      > var searchStr:String = search_txt.text.toLowerCase();
                                                                      > var i:Number;
                                                                      > var j:Number;
                                                                      > var nodeIndex:Number;
                                                                      >
                                                                      > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                                                                      > var searchArr:Array = new Array();
                                                                      > searchArr =
                                                                      > String(navXML.firstChild.childNodes .attributes.search).split(",");
                                                                      > for (j=0; j<searchArr.length; j++) {
                                                                      > if (searchStr == searchArr[j].toLowerCase()) {
                                                                      > nodeIndex = i;
                                                                      > break;
                                                                      > }
                                                                      > }
                                                                      > if (nodeIndex != undefined) {
                                                                      > break;
                                                                      > }
                                                                      > }
                                                                      >
                                                                      > return navXML.firstChild.childNodes[nodeIndex];
                                                                      > }
                                                                      >


                                                                      Couple things here. I am not sure what you are returning to? search_mc is
                                                                      a MovieClip, so you are returning a Node to the onRelease? Think that may
                                                                      be a typo.

                                                                      As far as speed... couple things. I am not sure about actionscript and its
                                                                      lookup times for executions like this... but, first things first.

                                                                      You actually don't need to break up the string into other words. Thanks to
                                                                      the indexOf method of the String Class. You can just do a test
                                                                      if (yoursearchValue.indexOf(searchWord) > -1) {
                                                                      found it
                                                                      }

                                                                      I also think you may be better served parsing your XML into a native Flash
                                                                      Datatype like an Array of Object like this:
                                                                      myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                                                                      keywords:"two,2"}]

                                                                      To build that Array you could do the loop like listed in the previous reply.
                                                                      Then when you do your search you would just loop this array of objects
                                                                      checking for the indexOf on the keywords property.

                                                                      I also think it depends on how much data you are going to be handling here.
                                                                      The parsing into the myFinisedObject gets better the more stuff you give it
                                                                      I think (again I am not sure how fast it is in comparison - but if you try
                                                                      it, let me know)



                                                                      • 32. Re: Making a &quot;search&quot; box...
                                                                        Level 7

                                                                        "TimSymons" <webforumsuser@macromedia.com> wrote in message
                                                                        news:efjpj9$fhk$1@forums.macromedia.com...
                                                                        >I did not test this but you could start with something like this and
                                                                        >probably
                                                                        > optimize it for speed.
                                                                        >
                                                                        >
                                                                        >
                                                                        > Tim
                                                                        >
                                                                        >
                                                                        >
                                                                        >
                                                                        > // search_txt, search_mc already exist on timeline
                                                                        > //
                                                                        > // assume also that the following XML data was read/parsed into the navXML
                                                                        > variable:
                                                                        > /*
                                                                        > <?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>
                                                                        > */
                                                                        >
                                                                        > search_mc.onRelease = searchXML;
                                                                        >
                                                                        > function searchXML():XMLNode {
                                                                        > var searchStr:String = search_txt.text.toLowerCase();
                                                                        > var i:Number;
                                                                        > var j:Number;
                                                                        > var nodeIndex:Number;
                                                                        >
                                                                        > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                                                                        > var searchArr:Array = new Array();
                                                                        > searchArr =
                                                                        > String(navXML.firstChild.childNodes .attributes.search).split(",");
                                                                        > for (j=0; j<searchArr.length; j++) {
                                                                        > if (searchStr == searchArr[j].toLowerCase()) {
                                                                        > nodeIndex = i;
                                                                        > break;
                                                                        > }
                                                                        > }
                                                                        > if (nodeIndex != undefined) {
                                                                        > break;
                                                                        > }
                                                                        > }
                                                                        >
                                                                        > return navXML.firstChild.childNodes[nodeIndex];
                                                                        > }
                                                                        >


                                                                        Couple things here. I am not sure what you are returning to? search_mc is
                                                                        a MovieClip, so you are returning a Node to the onRelease? Think that may
                                                                        be a typo.

                                                                        As far as speed... couple things. I am not sure about actionscript and its
                                                                        lookup times for executions like this... but, first things first.

                                                                        You actually don't need to break up the string into other words. Thanks to
                                                                        the indexOf method of the String Class. You can just do a test
                                                                        if (yoursearchValue.indexOf(searchWord) > -1) {
                                                                        found it
                                                                        }

                                                                        I also think you may be better served parsing your XML into a native Flash
                                                                        Datatype like an Array of Object like this:
                                                                        myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                                                                        keywords:"two,2"}]

                                                                        To build that Array you could do the loop like listed in the previous reply.
                                                                        Then when you do your search you would just loop this array of objects
                                                                        checking for the indexOf on the keywords property.

                                                                        I also think it depends on how much data you are going to be handling here.
                                                                        The parsing into the myFinisedObject gets better the more stuff you give it
                                                                        I think (again I am not sure how fast it is in comparison - but if you try
                                                                        it, let me know)



                                                                        • 33. Re: Making a &quot;search&quot; box...
                                                                          Level 7

                                                                          "TimSymons" <webforumsuser@macromedia.com> wrote in message
                                                                          news:efjpj9$fhk$1@forums.macromedia.com...
                                                                          >I did not test this but you could start with something like this and
                                                                          >probably
                                                                          > optimize it for speed.
                                                                          >
                                                                          >
                                                                          >
                                                                          > Tim
                                                                          >
                                                                          >
                                                                          >
                                                                          >
                                                                          > // search_txt, search_mc already exist on timeline
                                                                          > //
                                                                          > // assume also that the following XML data was read/parsed into the navXML
                                                                          > variable:
                                                                          > /*
                                                                          > <?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>
                                                                          > */
                                                                          >
                                                                          > search_mc.onRelease = searchXML;
                                                                          >
                                                                          > function searchXML():XMLNode {
                                                                          > var searchStr:String = search_txt.text.toLowerCase();
                                                                          > var i:Number;
                                                                          > var j:Number;
                                                                          > var nodeIndex:Number;
                                                                          >
                                                                          > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                                                                          > var searchArr:Array = new Array();
                                                                          > searchArr =
                                                                          > String(navXML.firstChild.childNodes .attributes.search).split(",");
                                                                          > for (j=0; j<searchArr.length; j++) {
                                                                          > if (searchStr == searchArr[j].toLowerCase()) {
                                                                          > nodeIndex = i;
                                                                          > break;
                                                                          > }
                                                                          > }
                                                                          > if (nodeIndex != undefined) {
                                                                          > break;
                                                                          > }
                                                                          > }
                                                                          >
                                                                          > return navXML.firstChild.childNodes[nodeIndex];
                                                                          > }
                                                                          >


                                                                          Couple things here. I am not sure what you are returning to? search_mc is
                                                                          a MovieClip, so you are returning a Node to the onRelease? Think that may
                                                                          be a typo.

                                                                          As far as speed... couple things. I am not sure about actionscript and its
                                                                          lookup times for executions like this... but, first things first.

                                                                          You actually don't need to break up the string into other words. Thanks to
                                                                          the indexOf method of the String Class. You can just do a test
                                                                          if (yoursearchValue.indexOf(searchWord) > -1) {
                                                                          found it
                                                                          }

                                                                          I also think you may be better served parsing your XML into a native Flash
                                                                          Datatype like an Array of Object like this:
                                                                          myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                                                                          keywords:"two,2"}]

                                                                          To build that Array you could do the loop like listed in the previous reply.
                                                                          Then when you do your search you would just loop this array of objects
                                                                          checking for the indexOf on the keywords property.

                                                                          I also think it depends on how much data you are going to be handling here.
                                                                          The parsing into the myFinisedObject gets better the more stuff you give it
                                                                          I think (again I am not sure how fast it is in comparison - but if you try
                                                                          it, let me know)



                                                                          • 34. Re: Making a &quot;search&quot; box...
                                                                            Level 7

                                                                            "TimSymons" <webforumsuser@macromedia.com> wrote in message
                                                                            news:efjpj9$fhk$1@forums.macromedia.com...
                                                                            >I did not test this but you could start with something like this and
                                                                            >probably
                                                                            > optimize it for speed.
                                                                            >
                                                                            >
                                                                            >
                                                                            > Tim
                                                                            >
                                                                            >
                                                                            >
                                                                            >
                                                                            > // search_txt, search_mc already exist on timeline
                                                                            > //
                                                                            > // assume also that the following XML data was read/parsed into the navXML
                                                                            > variable:
                                                                            > /*
                                                                            > <?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>
                                                                            > */
                                                                            >
                                                                            > search_mc.onRelease = searchXML;
                                                                            >
                                                                            > function searchXML():XMLNode {
                                                                            > var searchStr:String = search_txt.text.toLowerCase();
                                                                            > var i:Number;
                                                                            > var j:Number;
                                                                            > var nodeIndex:Number;
                                                                            >
                                                                            > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                                                                            > var searchArr:Array = new Array();
                                                                            > searchArr =
                                                                            > String(navXML.firstChild.childNodes .attributes.search).split(",");
                                                                            > for (j=0; j<searchArr.length; j++) {
                                                                            > if (searchStr == searchArr[j].toLowerCase()) {
                                                                            > nodeIndex = i;
                                                                            > break;
                                                                            > }
                                                                            > }
                                                                            > if (nodeIndex != undefined) {
                                                                            > break;
                                                                            > }
                                                                            > }
                                                                            >
                                                                            > return navXML.firstChild.childNodes[nodeIndex];
                                                                            > }
                                                                            >


                                                                            Couple things here. I am not sure what you are returning to? search_mc is
                                                                            a MovieClip, so you are returning a Node to the onRelease? Think that may
                                                                            be a typo.

                                                                            As far as speed... couple things. I am not sure about actionscript and its
                                                                            lookup times for executions like this... but, first things first.

                                                                            You actually don't need to break up the string into other words. Thanks to
                                                                            the indexOf method of the String Class. You can just do a test
                                                                            if (yoursearchValue.indexOf(searchWord) > -1) {
                                                                            found it
                                                                            }

                                                                            I also think you may be better served parsing your XML into a native Flash
                                                                            Datatype like an Array of Object like this:
                                                                            myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                                                                            keywords:"two,2"}]

                                                                            To build that Array you could do the loop like listed in the previous reply.
                                                                            Then when you do your search you would just loop this array of objects
                                                                            checking for the indexOf on the keywords property.

                                                                            I also think it depends on how much data you are going to be handling here.
                                                                            The parsing into the myFinisedObject gets better the more stuff you give it
                                                                            I think (again I am not sure how fast it is in comparison - but if you try
                                                                            it, let me know)



                                                                            • 35. Re: Making a &quot;search&quot; box...
                                                                              Level 7

                                                                              "TimSymons" <webforumsuser@macromedia.com> wrote in message
                                                                              news:efjpj9$fhk$1@forums.macromedia.com...
                                                                              >I did not test this but you could start with something like this and
                                                                              >probably
                                                                              > optimize it for speed.
                                                                              >
                                                                              >
                                                                              >
                                                                              > Tim
                                                                              >
                                                                              >
                                                                              >
                                                                              >
                                                                              > // search_txt, search_mc already exist on timeline
                                                                              > //
                                                                              > // assume also that the following XML data was read/parsed into the navXML
                                                                              > variable:
                                                                              > /*
                                                                              > <?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>
                                                                              > */
                                                                              >
                                                                              > search_mc.onRelease = searchXML;
                                                                              >
                                                                              > function searchXML():XMLNode {
                                                                              > var searchStr:String = search_txt.text.toLowerCase();
                                                                              > var i:Number;
                                                                              > var j:Number;
                                                                              > var nodeIndex:Number;
                                                                              >
                                                                              > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                                                                              > var searchArr:Array = new Array();
                                                                              > searchArr =
                                                                              > String(navXML.firstChild.childNodes .attributes.search).split(",");
                                                                              > for (j=0; j<searchArr.length; j++) {
                                                                              > if (searchStr == searchArr[j].toLowerCase()) {
                                                                              > nodeIndex = i;
                                                                              > break;
                                                                              > }
                                                                              > }
                                                                              > if (nodeIndex != undefined) {
                                                                              > break;
                                                                              > }
                                                                              > }
                                                                              >
                                                                              > return navXML.firstChild.childNodes[nodeIndex];
                                                                              > }
                                                                              >


                                                                              Couple things here. I am not sure what you are returning to? search_mc is
                                                                              a MovieClip, so you are returning a Node to the onRelease? Think that may
                                                                              be a typo.

                                                                              As far as speed... couple things. I am not sure about actionscript and its
                                                                              lookup times for executions like this... but, first things first.

                                                                              You actually don't need to break up the string into other words. Thanks to
                                                                              the indexOf method of the String Class. You can just do a test
                                                                              if (yoursearchValue.indexOf(searchWord) > -1) {
                                                                              found it
                                                                              }

                                                                              I also think you may be better served parsing your XML into a native Flash
                                                                              Datatype like an Array of Object like this:
                                                                              myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                                                                              keywords:"two,2"}]

                                                                              To build that Array you could do the loop like listed in the previous reply.
                                                                              Then when you do your search you would just loop this array of objects
                                                                              checking for the indexOf on the keywords property.

                                                                              I also think it depends on how much data you are going to be handling here.
                                                                              The parsing into the myFinisedObject gets better the more stuff you give it
                                                                              I think (again I am not sure how fast it is in comparison - but if you try
                                                                              it, let me know)



                                                                              • 36. Re: Making a &quot;search&quot; box...
                                                                                Level 7

                                                                                "TimSymons" <webforumsuser@macromedia.com> wrote in message
                                                                                news:efjpj9$fhk$1@forums.macromedia.com...
                                                                                >I did not test this but you could start with something like this and
                                                                                >probably
                                                                                > optimize it for speed.
                                                                                >
                                                                                >
                                                                                >
                                                                                > Tim
                                                                                >
                                                                                >
                                                                                >
                                                                                >
                                                                                > // search_txt, search_mc already exist on timeline
                                                                                > //
                                                                                > // assume also that the following XML data was read/parsed into the navXML
                                                                                > variable:
                                                                                > /*
                                                                                > <?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>
                                                                                > */
                                                                                >
                                                                                > search_mc.onRelease = searchXML;
                                                                                >
                                                                                > function searchXML():XMLNode {
                                                                                > var searchStr:String = search_txt.text.toLowerCase();
                                                                                > var i:Number;
                                                                                > var j:Number;
                                                                                > var nodeIndex:Number;
                                                                                >
                                                                                > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                                                                                > var searchArr:Array = new Array();
                                                                                > searchArr =
                                                                                > String(navXML.firstChild.childNodes .attributes.search).split(",");
                                                                                > for (j=0; j<searchArr.length; j++) {
                                                                                > if (searchStr == searchArr[j].toLowerCase()) {
                                                                                > nodeIndex = i;
                                                                                > break;
                                                                                > }
                                                                                > }
                                                                                > if (nodeIndex != undefined) {
                                                                                > break;
                                                                                > }
                                                                                > }
                                                                                >
                                                                                > return navXML.firstChild.childNodes[nodeIndex];
                                                                                > }
                                                                                >


                                                                                Couple things here. I am not sure what you are returning to? search_mc is
                                                                                a MovieClip, so you are returning a Node to the onRelease? Think that may
                                                                                be a typo.

                                                                                As far as speed... couple things. I am not sure about actionscript and its
                                                                                lookup times for executions like this... but, first things first.

                                                                                You actually don't need to break up the string into other words. Thanks to
                                                                                the indexOf method of the String Class. You can just do a test
                                                                                if (yoursearchValue.indexOf(searchWord) > -1) {
                                                                                found it
                                                                                }

                                                                                I also think you may be better served parsing your XML into a native Flash
                                                                                Datatype like an Array of Object like this:
                                                                                myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                                                                                keywords:"two,2"}]

                                                                                To build that Array you could do the loop like listed in the previous reply.
                                                                                Then when you do your search you would just loop this array of objects
                                                                                checking for the indexOf on the keywords property.

                                                                                I also think it depends on how much data you are going to be handling here.
                                                                                The parsing into the myFinisedObject gets better the more stuff you give it
                                                                                I think (again I am not sure how fast it is in comparison - but if you try
                                                                                it, let me know)



                                                                                • 37. Re: Making a &quot;search&quot; box...
                                                                                  Level 7

                                                                                  "TimSymons" <webforumsuser@macromedia.com> wrote in message
                                                                                  news:efjpj9$fhk$1@forums.macromedia.com...
                                                                                  >I did not test this but you could start with something like this and
                                                                                  >probably
                                                                                  > optimize it for speed.
                                                                                  >
                                                                                  >
                                                                                  >
                                                                                  > Tim
                                                                                  >
                                                                                  >
                                                                                  >
                                                                                  >
                                                                                  > // search_txt, search_mc already exist on timeline
                                                                                  > //
                                                                                  > // assume also that the following XML data was read/parsed into the navXML
                                                                                  > variable:
                                                                                  > /*
                                                                                  > <?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>
                                                                                  > */
                                                                                  >
                                                                                  > search_mc.onRelease = searchXML;
                                                                                  >
                                                                                  > function searchXML():XMLNode {
                                                                                  > var searchStr:String = search_txt.text.toLowerCase();
                                                                                  > var i:Number;
                                                                                  > var j:Number;
                                                                                  > var nodeIndex:Number;
                                                                                  >
                                                                                  > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                                                                                  > var searchArr:Array = new Array();
                                                                                  > searchArr =
                                                                                  > String(navXML.firstChild.childNodes .attributes.search).split(",");
                                                                                  > for (j=0; j<searchArr.length; j++) {
                                                                                  > if (searchStr == searchArr[j].toLowerCase()) {
                                                                                  > nodeIndex = i;
                                                                                  > break;
                                                                                  > }
                                                                                  > }
                                                                                  > if (nodeIndex != undefined) {
                                                                                  > break;
                                                                                  > }
                                                                                  > }
                                                                                  >
                                                                                  > return navXML.firstChild.childNodes[nodeIndex];
                                                                                  > }
                                                                                  >


                                                                                  Couple things here. I am not sure what you are returning to? search_mc is
                                                                                  a MovieClip, so you are returning a Node to the onRelease? Think that may
                                                                                  be a typo.

                                                                                  As far as speed... couple things. I am not sure about actionscript and its
                                                                                  lookup times for executions like this... but, first things first.

                                                                                  You actually don't need to break up the string into other words. Thanks to
                                                                                  the indexOf method of the String Class. You can just do a test
                                                                                  if (yoursearchValue.indexOf(searchWord) > -1) {
                                                                                  found it
                                                                                  }

                                                                                  I also think you may be better served parsing your XML into a native Flash
                                                                                  Datatype like an Array of Object like this:
                                                                                  myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                                                                                  keywords:"two,2"}]

                                                                                  To build that Array you could do the loop like listed in the previous reply.
                                                                                  Then when you do your search you would just loop this array of objects
                                                                                  checking for the indexOf on the keywords property.

                                                                                  I also think it depends on how much data you are going to be handling here.
                                                                                  The parsing into the myFinisedObject gets better the more stuff you give it
                                                                                  I think (again I am not sure how fast it is in comparison - but if you try
                                                                                  it, let me know)



                                                                                  • 38. Re: Making a &quot;search&quot; box...
                                                                                    Level 7

                                                                                    "TimSymons" <webforumsuser@macromedia.com> wrote in message
                                                                                    news:efjpj9$fhk$1@forums.macromedia.com...
                                                                                    >I did not test this but you could start with something like this and
                                                                                    >probably
                                                                                    > optimize it for speed.
                                                                                    >
                                                                                    >
                                                                                    >
                                                                                    > Tim
                                                                                    >
                                                                                    >
                                                                                    >
                                                                                    >
                                                                                    > // search_txt, search_mc already exist on timeline
                                                                                    > //
                                                                                    > // assume also that the following XML data was read/parsed into the navXML
                                                                                    > variable:
                                                                                    > /*
                                                                                    > <?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>
                                                                                    > */
                                                                                    >
                                                                                    > search_mc.onRelease = searchXML;
                                                                                    >
                                                                                    > function searchXML():XMLNode {
                                                                                    > var searchStr:String = search_txt.text.toLowerCase();
                                                                                    > var i:Number;
                                                                                    > var j:Number;
                                                                                    > var nodeIndex:Number;
                                                                                    >
                                                                                    > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                                                                                    > var searchArr:Array = new Array();
                                                                                    > searchArr =
                                                                                    > String(navXML.firstChild.childNodes .attributes.search).split(",");
                                                                                    > for (j=0; j<searchArr.length; j++) {
                                                                                    > if (searchStr == searchArr[j].toLowerCase()) {
                                                                                    > nodeIndex = i;
                                                                                    > break;
                                                                                    > }
                                                                                    > }
                                                                                    > if (nodeIndex != undefined) {
                                                                                    > break;
                                                                                    > }
                                                                                    > }
                                                                                    >
                                                                                    > return navXML.firstChild.childNodes[nodeIndex];
                                                                                    > }
                                                                                    >


                                                                                    Couple things here. I am not sure what you are returning to? search_mc is
                                                                                    a MovieClip, so you are returning a Node to the onRelease? Think that may
                                                                                    be a typo.

                                                                                    As far as speed... couple things. I am not sure about actionscript and its
                                                                                    lookup times for executions like this... but, first things first.

                                                                                    You actually don't need to break up the string into other words. Thanks to
                                                                                    the indexOf method of the String Class. You can just do a test
                                                                                    if (yoursearchValue.indexOf(searchWord) > -1) {
                                                                                    found it
                                                                                    }

                                                                                    I also think you may be better served parsing your XML into a native Flash
                                                                                    Datatype like an Array of Object like this:
                                                                                    myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                                                                                    keywords:"two,2"}]

                                                                                    To build that Array you could do the loop like listed in the previous reply.
                                                                                    Then when you do your search you would just loop this array of objects
                                                                                    checking for the indexOf on the keywords property.

                                                                                    I also think it depends on how much data you are going to be handling here.
                                                                                    The parsing into the myFinisedObject gets better the more stuff you give it
                                                                                    I think (again I am not sure how fast it is in comparison - but if you try
                                                                                    it, let me know)



                                                                                    • 39. Re: Making a &quot;search&quot; box...
                                                                                      Level 7

                                                                                      "TimSymons" <webforumsuser@macromedia.com> wrote in message
                                                                                      news:efjpj9$fhk$1@forums.macromedia.com...
                                                                                      >I did not test this but you could start with something like this and
                                                                                      >probably
                                                                                      > optimize it for speed.
                                                                                      >
                                                                                      >
                                                                                      >
                                                                                      > Tim
                                                                                      >
                                                                                      >
                                                                                      >
                                                                                      >
                                                                                      > // search_txt, search_mc already exist on timeline
                                                                                      > //
                                                                                      > // assume also that the following XML data was read/parsed into the navXML
                                                                                      > variable:
                                                                                      > /*
                                                                                      > <?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>
                                                                                      > */
                                                                                      >
                                                                                      > search_mc.onRelease = searchXML;
                                                                                      >
                                                                                      > function searchXML():XMLNode {
                                                                                      > var searchStr:String = search_txt.text.toLowerCase();
                                                                                      > var i:Number;
                                                                                      > var j:Number;
                                                                                      > var nodeIndex:Number;
                                                                                      >
                                                                                      > for (i=0; i<navXML.firstChild.childNodes.length; i++) {
                                                                                      > var searchArr:Array = new Array();
                                                                                      > searchArr =
                                                                                      > String(navXML.firstChild.childNodes .attributes.search).split(",");
                                                                                      > for (j=0; j<searchArr.length; j++) {
                                                                                      > if (searchStr == searchArr[j].toLowerCase()) {
                                                                                      > nodeIndex = i;
                                                                                      > break;
                                                                                      > }
                                                                                      > }
                                                                                      > if (nodeIndex != undefined) {
                                                                                      > break;
                                                                                      > }
                                                                                      > }
                                                                                      >
                                                                                      > return navXML.firstChild.childNodes[nodeIndex];
                                                                                      > }
                                                                                      >


                                                                                      Couple things here. I am not sure what you are returning to? search_mc is
                                                                                      a MovieClip, so you are returning a Node to the onRelease? Think that may
                                                                                      be a typo.

                                                                                      As far as speed... couple things. I am not sure about actionscript and its
                                                                                      lookup times for executions like this... but, first things first.

                                                                                      You actually don't need to break up the string into other words. Thanks to
                                                                                      the indexOf method of the String Class. You can just do a test
                                                                                      if (yoursearchValue.indexOf(searchWord) > -1) {
                                                                                      found it
                                                                                      }

                                                                                      I also think you may be better served parsing your XML into a native Flash
                                                                                      Datatype like an Array of Object like this:
                                                                                      myFinisedObject = [{url:"01.swf", keywords:"one"}, {url:"02.swf",
                                                                                      keywords:"two,2"}]

                                                                                      To build that Array you could do the loop like listed in the previous reply.
                                                                                      Then when you do your search you would just loop this array of objects
                                                                                      checking for the indexOf on the keywords property.

                                                                                      I also think it depends on how much data you are going to be handling here.
                                                                                      The parsing into the myFinisedObject gets better the more stuff you give it
                                                                                      I think (again I am not sure how fast it is in comparison - but if you try
                                                                                      it, let me know)



                                                                                      1 2 Previous Next