
Код AS1/AS2:
for (var i:Number = 1; i <= 20; i++) {
this["mc"+i].onPress=function () {
this.startDrag();
this.swapDepths(getNextHighestDepth());
}
this["mc"+i].onRelease=function () {
this.stopDrag();
for (var n:Number = 1; n <= 20; n++) {
if (this.hitTest(["m"+n])) {
this._x = ["m" + n]._x;
this._y = ["m" + n]._y;
trace ("ок");
delete this.onPress;
delete this.onRelease;
}
}
}
}