This content has been marked as final. Show 8 replies
why do you use i.newxml variable? Is there any reason on using that?
cos, I guess you can create a new variable inside the loop. Just try it and let me know if it works..
your for-loop is incorrect and you shouldn't nest a named function - loadXML().
use the trace() function to see what you're doing in your for-loop.
I tried changing the code inside the loop to use just "newxml" instead of "i.newxml", and I declared with "var newxml = new XML();" - was this what you were thinking?
The reason I tried to use the loadXML() function in the loop was so that for each node in my "main.xml" it would load the new xml file listed - this is a no-no? Do you have any ideas as to what I could do?
For the for-loop, what should I change in it? I'm not great with loops so I tried to modify some code from another loop I found in another forum thread - not the right way to do it here?
Also, what should I trace? The value of the _root.address, or i.attributes.location? I have created dynamic text boxes on my stage to see if the correct value from the xml file loads (ie. the name of the xml file within the xml file) and it does, but now I don't know how to put that information into ANOTHER loadXML() function and get the node information from it - does that make sense???
Below are the examples of the xml files I am using. In the first one, main.xml, I will have a list of multiple xml files, each with the same nodes and elements as in the details.xml file (different values, of course).
This is just to give you an example of what I'm trying to accomplish - pulling ALL the addresses and phone numbers from multiple xml files. I cannot manually collect this information, as it is dynamic, and will be updated in each individual details.xml. I was hoping to collect the information by simply adding to and updating ONE xml file - main.xml.
Do you think this can be done? Am I going about it the wrong way? I'm quite limited in AS knowledge, which is why I'm piecing together code from other posts!
Well, that seems to be working - I added a couple extra xml files to the main.xml and it is loading the details from each file.
Now, if I want to store the information for each address and phone number from each xml file, I would have to setup the function parseXML() to store the information into a variable - could I use something like below?
I know my syntax sucks, but I'm learning!
not if count and _root.count are the same:
count is numeric variable. you can't assign address and phone properties to it.
addressA = ;
phoneA = ;
Thanks for all the help kglad - you've really helped me move forward with this project!