# Rewriting array data?

**URL:** <https://forum.kirupa.com/t/rewriting-array-data/147551>\
**Category:** Uncategorized\
**Created:** [May 11, 2005, 3:56pm UTC](https://forum.kirupa.com/t/rewriting-array-data/147551 "2005-05-11T15:56:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![daveFelton](https://avatars.discourse-cdn.com/v4/letter/d/bb73d2/32.png) [@daveFelton](https://forum.kirupa.com/u/daveFelton)\
**Post date:** [May 11, 2005, 3:56pm UTC](https://forum.kirupa.com/t/rewriting-array-data/147551/1 "2005-05-11T15:56:58Z")

</div>

okay so i have this code:

```auto

myArray = new Array();

for (i=0; i<items; i++) {
   //bunch of XML stuff
   myArray.push(0);
}

//sometime later...
button.onRelease = function() {
   myArray[buttonID] = 1;
   trace(myArray);	//outputs :: 0,0,0,0,0...for however many items i have
}

```

okay, so obviously there is stuff missing from my code b.c i dont feel like copying it all over. its basically an XML controlled style blog, and i’m trying to keep track of whether an entry is open (0), or closed (1), and those values are being stored in ‘myArray’.

my question is, why isnt that call to myArray overwriting the existing data? i know i have doen this before (maybe not in this fashion, but i know its possible). anyone know what im doing wrong?

thanks!

d
