# Simple xm/array question

**URL:** <https://forum.kirupa.com/t/simple-xm-array-question/327985>\
**Category:** Uncategorized\
**Created:** [April 11, 2012, 5:17am UTC](https://forum.kirupa.com/t/simple-xm-array-question/327985 "2012-04-11T05:17:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ronmac](https://avatars.discourse-cdn.com/v4/letter/r/7ea924/32.png) [@ronmac](https://forum.kirupa.com/u/ronmac)\
**Post date:** [April 11, 2012, 5:17am UTC](https://forum.kirupa.com/t/simple-xm-array-question/327985/1 "2012-04-11T05:17:15Z")

</div>

This probably has a simple solution.

I have an xml file that I load and parse with no problem. I have a number of buttons that are on the stage. I want to link the buttons with the xml file. I have simplified it here

The sample xml file is like this

\<xml\>

\<item\>  
\<name\>George\</name\>  
\</item\>

\<item\>  
\<name\>Bill\</name\>  
\</item\>

\<item\>  
\<name\>Henry\</name\>  
\</item\>

\</xml\>

I have three buttons on the stage. When I click button \_1, I want to access the value in the first element in the xml file (George). And so on with button\_2 and button\_3.

I’m guessing you put the buttons in an array. How do you link the button array with the xml array?

Thanks in advance.
