Onrelease/attachmovie problem

attaching and clicking on the movie clips in the following code works. However. the trace in the onRelease function only shows me what is in the last array record in this case “the third string” no matter which movie I click .

Can anyone show me the correct way?
[AS]


moving_var = 0;
text_placement = 1;
my_array = array();
my_array[0] = “the first string”;
my_array[1] = “the second string”;
my_array[2] = “the third string”;
while (moving_var < 5) {
_root.attachMovie(“state_text_mv”, “state_list” + [moving_var], moving_var);
_root[“state_list” + [moving_var]].state_text.text = my_array[moving_var];
_root[“state_list” + [moving_var]].onRelease = function() {
trace(my_array[moving_var]);
};
moving_var++;
}
[/AS]


thanks