2 Replies Latest reply on Mar 22, 2007 11:00 AM by sbryner

    Searching an XML File

    sbryner Level 1
      Hello,

      Months ago. I was creating an xml search for my flash project.
      I'm now revisiting it after learning the php to maintain the xml file on the server.

      I was wondering if somebody could help me. I had it working before I changed over
      to do the server-side scripting. Now it will not work.

      The file with my comments are attached. Please help me I'm stuck and all I need
      to do is get this stinkin' code to work so I can finish this year long learning website
      up.

      In short: I have posted this problem before and Kglad so kindly helped me. Though,
      now looking back on the posts I'm lost and need to get it to work again with an external
      XML file. My traces I have pull up the correct searchCriteria and the whole XML file.

      I just can't seem to get it to sort the correct props == val out and display them.

      Can you see where I'm stuck? I can't.
        • 1. Re: Searching an XML File
          sbryner Level 1
          Checking it out. I've figured at least part of my problem is that I'm not loading my xml file into my variable or at least accessing it correctly.

          var nodesToLookIn = myXML.firstChild.childNodes;

          does not equal my xml file for some reason
          any thoughts?

          Also, I don't think I need my prototype.search either.
          Shouldn't I be able to just use the searchXML function?
          • 2. Re: Searching an XML File
            sbryner Level 1
            Answered my own Question:

            The attached code is the results to search an XML file that worked for me.
            I'll try and comment the best I can in case somebody else can use it.

            Set up:
            1) main. swf file loads my search.swf file

            2) search.swf has both dropdown box component and dynamic text component to search for
            (ie... _global.searchCriteria = dynamicText.text and _global.searchCriteria = componentName.value)
            each search field has a button to open the search_results.swf

            3) search_results.swf contains the actuall xml search and displays the content to the screen.
            **(note both search.swf & search_result.swf are loaded into a loader component in main.swf so no screens ever change).

            If this helps just one person it'll make it worth it.
            good luck,
            sky