In Actionscript 3, we can access a XML object in a E4X style like:
var a:XML =
<book>
<title>ABC</title>
</book>;
trace(a.title);
But what if we get the tag name from within an object or class?
trace(a.Constants.BOOK_TAG);
In Actionscript 3, we can access a XML object in a E4X style like:
var a:XML =
<book>
<title>ABC</title>
</book>;
trace(a.title);
But what if we get the tag name from within an object or class?
trace(a.Constants.BOOK_TAG);
trace(a.children()[0].name());
I read a piece today answering my question:
trace(a.[Constants.BOOK_TAG]);
the square bracket notation works for use parameter in E4X.