You didn't specify how you intend to assign numbers to the boxes, but yes, you can do that.

Code:
var n = 1;
for (n = 1; n <= NBR_ROWS*NBR_COLUMNS; ++n) 
{
  var mc = _root["mc"+n];
  if (x == mc.number) {
     trace("show message here");
     break;
  }
}