# Tutorial on XML For Loop

**URL:** <https://forum.kirupa.com/t/tutorial-on-xml-for-loop/305428>\
**Category:** flash\
**Created:** [February 25, 2010, 3:02am UTC](https://forum.kirupa.com/t/tutorial-on-xml-for-loop/305428 "2010-02-25T03:02:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![worthless](https://avatars.discourse-cdn.com/v4/letter/w/50afbb/32.png) [@worthless](https://forum.kirupa.com/u/worthless)\
**Post date:** [February 25, 2010, 3:02am UTC](https://forum.kirupa.com/t/tutorial-on-xml-for-loop/305428/1 "2010-02-25T03:02:05Z")

</div>

Very basic xml for loop question. this is the xml

\<?xml version=“1.0” encoding=“iso-8859-1”?\>

\<inventor\>

\<person\>

\<name\> abc\</name\>  
\<comment \>first comment\</comment\>  
\</person\>

\<person\>

\<name\> xyz\</name\>  
\<comment \>second comment\</comment\>  
\</person\>  
\</inventor\>

NOw in the Fla there is two dynamic text field with instance name "name\_txt"and “comment\_txt” and some thumbnail images as button representing different persons “1”, “2”, “3” and so on.

What I want when the user click the buttons the name and the comment will change accordingly. I think for loop is best for this one.

Shall be glad if any one give me some good and effective tutorial on this.

Regards

Worthless.

I uploaded the files for your kind look. Please help.

So is it not possible to loop through the child elements of the xml file. Please help me.
