Suppose I have an XML
<xml>
<lang>en</lang>
<en>
<text id="123">One Two Three</text>
<text id="hello">Hello</text>
</en>
</xml>
the “en” tag is only if the lang value is “en”.
If the value of lang is “de”
<lang>de</lang>
<de>
<text id="123">One Two Three</text>
<text id="hello">Hello</text>
</de>
How do I get this name dinamicaly in my actionscript 3 code.
Suppose I want to use
var xmlVal = new XML(... the above xml)
var lang = xmlVal.lang;
I can’t use if (xmlVal.lang == “en”) .. because the lang value can be any string. but there should be a child node in that name..!!
How do I get values from node “en or de or what ever..” ??
Haven’t tested, but this should give you the general idea (that you can dynamically select using the “key”):