var applex, appley, waterx, watery;
count = 0;
apple.onPress = function() {
count += 1;
applex = apple._x;
appley = apple._y;
_root.apple.duplicateMovieClip(“apple”+count, count);
dupapple = eval(“apple”+count);
startDrag(dupapple);
dupapple.onRelease = function() {
stopDrag();
process(dupapple);
};
}
water.onPress = function() {
count += 1;
_root.water.duplicateMovieClip(“water”+count, count);
dupwater = eval(“water”+count);
startDrag(dupwater);
dupwater.onRelease = function() {
stopDrag();
process(dupwater);
};
}
function process(arg) {
if (arg.hitTest(_root.box1)) {
arg._x = box1._x;
arg._y = box1._y;
} else if (arg.hitTest(_root.box2)) {
arg._x = box2._x;
arg._y = box2._y;
} else if (arg.hitTest(_root.box3)) {
arg._x = box3._x;
arg._y = box3._y;
} else if (arg.hitTest(_root.box4)) {
arg._x = box4._x;
arg._y = box4._y;
} else {
arg._x = applex._x;
arg._y = appley._y;
arg._x = waterx._x;
arg._y = watery._y;
}
}