I’m trying to use hitTest to detect if a dragged clip is over any one of 3 different targets - when it is I want that target to blink. And then when I drag off I’d like the blinking to stop. Make sense? I’m struggling a bit with the following code:
square_mc.onPress = function() {
this.startDrag();
for (z=1; z<4; z++) {
circle = _root["circle"+z+"_mc"];
this.onEnterFrame = function() {
if (this.hitTest(eval(circle))) {
//trace(eval(circle));
trace("You are over a circle");
eval(circle).gotoAndPlay("loop");
delete this.onEnterFrame;
}
};
}
};
square_mc.onRelease = function() {
this.stopDrag();
trace("You released over the circle");
eval(circle).gotoAndPlay("off");
};
The “eval(circle)” part isn’t really working. What’s a better way to express the name of current target clip? Thanks for the help.