A simple eval may be all you need.
Var parts:Array = inputText.split(".");
While (parts.length)
Node = node[parts.unshift()];
-Alex
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of
artclifford
Sent: Sunday, December 07, 2008 3:21 AM
To: [email protected]
Subject: [flexcoders] e4x Strings?
I am familiar with e4x and know generally how to get information I need
when I know the structure of an XML file. I was going to put together a
utility as tutorial for new-hires to allow trying e4x to get different
values.
I quickly ran into the problem that I cannot see a way to allow this to
happen without creating my own e4x interpreter. Am I missing something?
If I wanted a user to enter a string like "[EMAIL PROTECTED]" and
want to get the xmllist matching that e4x string on an XML object can I
do that? I know that [EMAIL PROTECTED] will give me what I
want, I even know that xmlVar["somenode"]["@someAttribute"] will give
me what I want. But xmlVar["[EMAIL PROTECTED]"] doesn't work. Nor
does xmlVar.decendants("[EMAIL PROTECTED]");
I know Adobe has the D.eval stuff for providing eval in AS, but I was
hopeing for a solution that doesn't require external libraries.
Thanks for any input,
ArtC