Event Handler Problem on Nested MC
I'm using the following code to dynamcially create movieclips inside another movieclip called "picStrip" from an array of JPGs:
for (var i = 0; i<imageArray.length; i++) {
var thisImage:String = "image"+i;
picStrip.createEmptyMovieClip(thisImage, picStrip.getNextHighestDepth());
eval("picStrip."+thisImage).loadMovie(imageArray[i]);
eval("picStrip."+thisImage)._x = (101*i);
eval("picStrip."+thisImage)._y = 0;
}
For some reason, I am unable to access the event handler functionality of the dynamically generated MCs:
_root.picStrip.image1.onRelease = function() {
trace("Did this work?");
}
I know my MCs exist, because I can manipulate their properties:
_root.picStrip.image1._alpha=25;
picStrip does not have any event handling on it, so that is not the issue. What am I doing wrong here? Surely there is a way to do this...
Many thanks to anyone can help!
|