for (i=0; i<total; i++) { my_array[i].ind = i; my_array[i].onRollOver =function(){ trace(this.ind) } }