# Changing attribute values E4X

**URL:** <https://forum.kirupa.com/t/changing-attribute-values-e4x/247835>\
**Category:** Uncategorized\
**Created:** [December 30, 2007, 7:11pm UTC](https://forum.kirupa.com/t/changing-attribute-values-e4x/247835 "2007-12-30T19:11:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jerryj](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@jerryj](https://forum.kirupa.com/u/jerryj)\
**Post date:** [December 30, 2007, 7:11pm UTC](https://forum.kirupa.com/t/changing-attribute-values-e4x/247835/1 "2007-12-30T19:11:23Z")

</div>

Hi,  
I am loading an xml file into flash and trying to change the attribute values within flash.  
I can change one value like this:

```auto
extraXML.item[3].@newID=String(300);

```

This changes the attribute value of the ‘id’ attribute in the fourth node just fine into ‘300’.  
But when I try to do this for all the nodes, like:

```auto
for(var n:uint=0; n <extraXML.item.length(); n++){
    trace(extraXML.item[n].@id)//traces the values correctly
   extraXML.item[n].@id=String(n);
// or: extraXML.item[n].@id=n;
   }

```

the values are being changed but come out messily organized, randomly as it seems. The idea is that I would like to number the id’s from 0 to extraXML.item.length().

Must be missing something!

Thanks,  
Jerryj.
