views:

202

answers:

2

So I have something like this:

var xmlStatement:String = "xmlObject.node[3].@thisValue";

What mystery function do I have to use so that I can execute xmlStatement and get thisValue from that xmlObject? Like....

var attribute:String = mysteryFunction(xmlStatement);

P.S. I know eval() works for actionscript2, I need the as3 solution. :)

+5  A: 

Unfortunately this is not possible in ActionScript 3. This however might be a solution: http://blog.betabong.com/2008/09/23/e4x-string-parser/

Christophe Herreman
awesome - that'll work for what I need it for! :)
onekidney
A: 

For your example it would be: var attribute : String = String( E4X.evaluate( XMLList(xmlobject) , 'node[3].@thisValue' ) );

Is this even a functioning code snippet, or a suggestion?
aaaidan