Answered
Parsing XML Data to add weather info to movie
Hello Everyone,
I am trying to display weather information in my flash movie. I am having problems parsing the information that I receive. I can get the line of data from the xml date that is returned when I do an xml load. The problem is that I can’t parse the data. I have simplified by code to trouble shoot the problem. I am beginning to think that the line I get from the xml data is not the same as normal string data.
When I run the “Examble 1” code I can pass the xml data to the ParseData function. When I trace the my_str (string) variable I see the data that I passed to the function and it looks correct. I then use the String.split method to pase the string into the my_array (array) variable. When I try to trace anything with my_array, the output is undefined. The trace(my_array.length) output is undefined
When I run the same code (see “Example 2”) and create my own string that contains the text that I am pull out of the xml data and pass it to the ParseData function the trace(my_array.length) output is 14 as it should be.
My question is what am I doing incorrectly?
Why doesn’t the parsing work when I processing the xml text and it will work when I pass the same text as a string that I hard coded and assigned to a string variable?
Note: the xml data that I am sending to the ParseData function is:
Current Conditions - 69.2F / 20.7C | Clear - 8:29 PM PDT Oct. 1
Thank you all in advance your help.
Steve

I am trying to display weather information in my flash movie. I am having problems parsing the information that I receive. I can get the line of data from the xml date that is returned when I do an xml load. The problem is that I can’t parse the data. I have simplified by code to trouble shoot the problem. I am beginning to think that the line I get from the xml data is not the same as normal string data.
When I run the “Examble 1” code I can pass the xml data to the ParseData function. When I trace the my_str (string) variable I see the data that I passed to the function and it looks correct. I then use the String.split method to pase the string into the my_array (array) variable. When I try to trace anything with my_array, the output is undefined. The trace(my_array.length) output is undefined
When I run the same code (see “Example 2”) and create my own string that contains the text that I am pull out of the xml data and pass it to the ParseData function the trace(my_array.length) output is 14 as it should be.
My question is what am I doing incorrectly?
Why doesn’t the parsing work when I processing the xml text and it will work when I pass the same text as a string that I hard coded and assigned to a string variable?
Note: the xml data that I am sending to the ParseData function is:
Current Conditions - 69.2F / 20.7C | Clear - 8:29 PM PDT Oct. 1
Thank you all in advance your help.
Steve
