How do you get the name of a movieclip that is cycling through an array?
var wallList:Array = new Array(wall1, wall2, wall3, wall4);
for (var i:int=0; i<wallList.length; i++) {
if (wallList*.hitTestObject(ME)){
lastWall = wallList*;
trace(lastWall);
}
}
In the case above I have “wall1,wall2,wall3,wall4” in an array and if ME is hitting one of the walls the name should be stored in lastWall.
The hitest works, I do get to trace but then lastWall (which is a string) is [MovieClip]
So what needs to be done to get the name “wall1”.
Thanks