# Dynamic field values for parsing XML

**URL:** https://forum.kirupa.com/t/dynamic-field-values-for-parsing-xml/300150
**Category:** flash
**Created:** [November 16, 2009, 10:22pm UTC](https://forum.kirupa.com/t/dynamic-field-values-for-parsing-xml/300150 "2009-11-16T22:22:53Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![SteveKlein](https://avatars.discourse-cdn.com/v4/letter/s/df788c/32.png) [@SteveKlein](https://forum.kirupa.com/u/SteveKlein)
#### Post date: [November 16, 2009, 10:22pm UTC](https://forum.kirupa.com/t/dynamic-field-values-for-parsing-xml/300150/1 "2009-11-16T22:22:53Z")

</div>

Hello, All-

I’ve been using Kirupa’s XML tutorial ( [kirupa.com - Using XML in Flash CS3/AS3 - Page 1](http://www.kirupa.com/developer/flashcs3/using_xml_as3_pg1.htm)) to parse some information out of an XML object, but I’m stumped on how to access node names dynamically.

Specifically, here’s the bit of code I’m trying to implement (short and sweet):

> var **currentCategory** :String= “**[COLOR=“Lime”]proCat[/COLOR]**”+MovieClip(root).Global.categoryIndex;  
> trace ("Current Category for XML Parsing = "+currentCategory);  
> var proList:XMLList = MovieClip(root).Global.matchmakerItems.taxPros.taxPro.([COLOR=“Red”] **currentCategory** [/COLOR] == “true”);

I have a number of nodes for each taxPro named:

\<proCat0\>true\</proCat0\>  
\<proCat1\>false\</proCat1\>  
\<proCat2\>true\</proCat2\>, etc…

What I’m trying to do is access them through a dynamic variable as highlighted in red above.

If I hard code …taxPro.(proCat2 == “true”); all works great. However, I’m unable to make the targeted sub-node call with a dynamic variable.

If anyone can point to my shortsightedness and help me out of this funk I’d be greatly appreciative.

Thanks in advance,  
SteveK
