Project flash

Hello, i am a student, and for a project I have to make minesweeper!
This is my code to create the playfield, but the problem is when I click on a square, i don’t get the wright value wich is under it. So i have made a movieclip square with a dynamic textbox in it. And when I click on a square, the wright value from the array must appaer!

var wortel:Number=Math.sqrt(combobox_input.text);
var rowposition:Number = 0;
var ar:Array = maakVeld(txt_input.text, wortel, wortel);

for(i=0;i<wortel;i++){
for(j=0;j<wortel;j++){
var clip:MovieClip = _root.attachMovie(“square”,“square_mc”+rowposition,rowposition++);
clip._x = 250 + j * 26;
clip._y = 150 + i * 26;
clip.onRelease = function(){
this._alpha = 50;
var teller:Number = 0;
for (var z:Number = 0; z<ar.length; z++) {
for (var q:Number = 0; q<=wortel; q++) {
if(teller == this._name.substr(9,this._name.length)) {
this.displayText.text=ar[z][q];
break;
}
teller++;
}
}
}
}
}