0

Hi
Im working on an Actionscript 3 program where i will click through a tree structure of buttons and use the values of the particular set of buttons, to access its corresponding value in an XML file.
As i click each button, I start forming a string eg.

Click1 = unit1
Click2 = lesson3. etc
xmlString = "myXML."+ Click1 + "." + "Click2";
trace(xmlString)

Everything works perfect up to this point except that xmlString contains the incorrect value.
I want xmlString to contain the particular value within that particular element in the XML but instead it only displays the concatenated path. (myXML.unit1.lesson1)
It makes sense that it would display this value but my question is how would i be able to use that "xmlString" value to refernce the particular elements value.
Please note everything else works perfect and if i have to pass that XML path directly, "myXML.unit1.lesson1" it functions correctly, thus it must be an issue with the concatenated string not being registered as an XML path.
Im really so close to the finish line and I suspect this is very easy to do, so any help would be greatly appreciated.
Thanks JP

Edited by mike_2000_17: Fixed formatting

1
Contributor
1
Reply
3
Views
7 Years
Discussion Span
Last Post by Jarredpsmith
0

Hi i made a error when typing out the post. Please not this line must change to the one below.
xmlString = "myXML."+ Click1 + "." + "Click2";

xmlString = "myXML."+ Click1 + "." + Click2;

Any help would be really appreciated.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.