3 Replies Latest reply on Feb 16, 2007 1:11 PM by liquidleaf

    xml file not loading

      i am trying to create an e-learning course that will have glossaries according to the various lessons that are within the overall course. i have attached the code that i am using to quickly switch out the glossary xml file (that contains the definitiosn and terms). I can currently trace the lessonNumber variable (it is reading "1"), but when I attempt to trace the glossaryText variable, the output window is blank....can anyone tell me where i am going wrong?
        • 1. Re: xml file not loading
          kglad Adobe Community Professional & MVP
          i see a trace(glossaryText) which won't reveal anything because glossaryText is your xml object. glossaryText is not a variable. the most you could hope for is to see [object][object] in the output panel, but even that won't happen with the xml class.
          • 2. Re: xml file not loading
            Mordred58 Level 1
            i was hoping to even see the object Object.....but i'm not even seeing that. what would be the best way to go about this?
            • 3. xml file not loading
              liquidleaf Level 1
              Just a hint - perhaps try putting your onLoad declaration BEFORE your load command. This way, your onload is present before the load is issued, so in case the XML is loaded really quickly, the onLoad handler will get called for sure. Does this make sense? In your case, the XML may have already loaded before you tell the object WHAT to call after it's loaded.

              When I've used the xml object, it looks more like this:
              myXML = new XML();
              myXML.onLoad = someFunction;

              Also -afterwards, you have to select a node of the XML to view. I use the XPath API to do so, by including this
              import mx.xpath.XPathAPI;

              And then using:
              XPathAPI.selectSingleNode within an onLoad function. Take a look at the documentation for XPathAPI - I had to make a custom function to return the node I wanted.

              Hope this helps you.