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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.