For loop

Okay, I am intending to display user’s info on swf and I have stored them in xml files…


<?xml  version="1.0"?>
<users>
    <user1>
        <name>1a</name>
        <link>1b</link>
        <email>1c</email>
    </user1>
    <user2>
        <name>2a</name>
        <link>2b</link>
        <email>2c</email>
    </user2>
    <user3>
        <name>3a</name>
        <link>3b</link>
        <email>3c</email>
    </user3>
</users>

This is an example, I hope you get this. So, I have 3 dynamic text field in my fla however I don’t know what instance name I should give. I want to have a loop to help me auto-fill in these three text fields… and my idea is like this…


for (y=0; y<3; y++) {
    y_name_txt = this.firstChild.childNodes[y].childNodes[y].firstChild.nodeValue;
        }

Please try to help, and tutorials or suggestions will be appreciated. Thanks alot for dropping by this post and thanks in advance :stuck_out_tongue: