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