Use a for loop:
ActionScript Code:
for(i=1;i<=5;++i){
if(this["mcname"+i].hitTest(someObject)){
// do something
}
}
scope[
parts]
that is the syntax for dynamically referring to an object, where
scope is something like _root, this, _parent, etc. and
parts are the strings/numbers/variables you want to join together, for Flash to look for the object their name make up, in this case,
"mcname" + i (String + variable), which in this for loop would create a String like, "mcname0", "mcname1", etc. and then try and find an object with the same instance name