vendredi 11 septembre 2015

ActionScript: using variables w/E4X descendant accessor (..)

I'm using a descendant accessor like so:

var myxml:XMLList = new XMLList;

...

myxml..node

and would like to replace it w/

const sNode:String = 'node';
myxml..[{sNode}]

This sort of thing has worked before.

const sAttrib:String = 'attrib';
myxml.@[{sAttrib}]

works, but trying the same sort of thing w/a descendant accessor causes a compiler error.

Yes, I could do

myxml.descendants(sNode)

but I'd rather do it w/operators, if I can.

The XML might be something like:

<map>
    <node>
       <node />
    </node>
</map>



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire