Been working on this on and off throughout the day, and am having no luck.
On the stage are 3 instances of a Target MovieClip. Through scripting, an
empty MovieClip is created. Then, MCs (Pentagon, Square, and Triangle) are
added from the library into the empty MC. At this time, an array is made
listing the instance names of these MCs.
I would like to use this array (aInstanceNamesInMCContainer) to perform a hit
test against the Target MCs, but I?m getting hung up on the syntax. The
problem is that I am not properly targeting the nested MC, but I have been
unable to figure out the solution.
Any help is appreciated.
//Defines a string.
var sShapeList:String = "Pentagon,Pentagon,Square,Triangle,Square,Pentagon";
//Creates a string from the string sShapeList.
var aShapeList:Array = sShapeList.split(",");
//Creates an empty MovieClip, and sets its position.
this.createEmptyMovieClip("mcContainer", this.getNextHighestDepth());
mcContainer._y = 230;
//Creates an empty array that will hold the instance names of the MCs found in
mcContainer.
var aInstanceNamesInMCContainer:Array = [];
//Attaches MovieClips from the library into mcContainer.
for (i = 0; i < aShapeList.length; i++){
mcContainer.attachMovie(aShapeList[i], aShapeList[i]+i,
mcContainer.getNextHighestDepth(), {_x: i * 95});
aInstanceNamesInMCContainer.push(aShapeList[i]+i);
}
//(Theoretically) Performs a hitTest against the 1st Target MC and the MCs
within mcContainer.
for (i = 0; i < aInstanceNamesInMCContainer.length; i++){
trace(mcTarget1.hitTest("mcContainer." +
String(aInstanceNamesInMCContainer[i])));
trace("mcContainer." + String(aInstanceNamesInMCContainer[i]));
}