0
votes

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);
2

2 Answers

0
votes
trace(a.children()[0].name());
0
votes

I read a piece today answering my question:

trace(a.[Constants.BOOK_TAG]);

the square bracket notation works for use parameter in E4X.