Rewriting array data?

okay so i have this code:

myArray = new Array();

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

//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?