0

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);
Edward Liang
  • 100
  • 1
  • 8

2 Answers2

0
trace(a.children()[0].name());
Kabir
  • 1,419
  • 17
  • 33
0

I read a piece today answering my question:

trace(a.[Constants.BOOK_TAG]);

the square bracket notation works for use parameter in E4X.

Edward Liang
  • 100
  • 1
  • 8