# Reading xml attributes

**URL:** <https://forum.kirupa.com/t/reading-xml-attributes/207589>\
**Category:** Uncategorized\
**Created:** [November 19, 2006, 6:11pm UTC](https://forum.kirupa.com/t/reading-xml-attributes/207589 "2006-11-19T18:11:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sean1983uk](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@sean1983uk](https://forum.kirupa.com/u/sean1983uk)\
**Post date:** [November 19, 2006, 6:11pm UTC](https://forum.kirupa.com/t/reading-xml-attributes/207589/1 "2006-11-19T18:11:19Z")

</div>

I’ve been given a file and i need to read values from a xml file into textfields in flash.

I’ve looked through tutorials and the xml stuff on here but still confuzzled

I’ve set up the dynamic textfields etc but having problems reading in the attributres from the file…

The XML file structure is:

\<dataFile\>  
\<data id=“019” att1=“misc” att2=“misc1”\>  
\<dataA att3=“misc2” att4=“misc3” /\>  
\<dataB att5=“misc4” att6=“misc5” /\>  
\</data\>  
\<data id=“019” att1=“misc” att2=“misc1”\>  
\<dataA att3=“misc2” att4=“misc3” /\>  
\<dataB att5=“misc4” att6=“misc5” /\>  
\</data\>  
\</dataFile\>

How would i read id, att1, att2, att3, att4, att5, att6 into the text fields

i’ve tried

for (i=0; i\<total; i++) {  
data\* = xmlNode.childNodes\*.childNodes[0].attributes.id;  
}

Help or links to info much appreciated.
