Aha, it is child(); So it would be:
myXML.RootNode.child("Item" + i);
Tracy Spratt,
Lariat Services, development services available
_____
From: [email protected] [mailto:[email protected]] On
Behalf Of Tracy Spratt
Sent: Friday, December 04, 2009 12:39 AM
To: [email protected]
Subject: [SPAM] RE: [SPAM] [flexcoders] Re: e4x Filtering with a variable?
One way is bracket notation:
myXML.RootNode["Item" + i]
There is another way, using a real xml method, but I don't recall it right
now. Maybe elements()?
Tracy Spratt,
Lariat Services, development services available
_____
From: [email protected] [mailto:[email protected]] On
Behalf Of invertedspear
Sent: Thursday, December 03, 2009 1:50 PM
To: [email protected]
Subject: [SPAM] [flexcoders] Re: e4x Filtering with a variable?
I was just doing something similar and found help here:
http://livedocs.
<http://livedocs.adobe.com/flex/3/html/help.html?content=13_Working_with_XML
_08.html>
adobe.com/flex/3/html/help.html?content=13_Working_with_XML_08.html
probably best you read through there and find the solution that is specific
for you.
Let us know if you still need help after reviewing that.
~Mike
--- In flexcod...@yahoogro <mailto:flexcoders%40yahoogroups.com> ups.com,
"flexcoder2008" <djohnso...@...> wrote:
>
> I have an XML structure that gets built dynamically. Nodes are constructed
with a number appending the node name and the number of these nodes depends
on values in a database. The structure looks like this:
>
> <RootNode>
> <Item1 />
> <Item2 />
> <Item3 />
>
> etc...
>
>
> Now I want to access a particular node using a variable.
>
> For example:
>
> var i:int = 2;
> myXML.RootNode.Item{i}
>
> but this is not working. How can I create an E4x expression that appends a
variable value onto a node name in the filter expression?
>