我好象哪没转过弯来,思路是用变量来记录前一MC的坐标,但搞了半天好象也没搞对,来求教了
复制内容到剪贴板
代码:
a1.onPress = function() {
startDrag(this);
this.swapDepths(getNextHighestDepth());
};
a2.onPress = function() {
startDrag(this);
this.swapDepths(getNextHighestDepth());
};
a1.onRelease = function() {
stopDrag();
if (a2.hitTest(a1)) {
a1._x = a2._x;
a1._y = a2._y;
}
};
a2.onRelease = function() {
stopDrag();
if (a1.hitTest(a2)) {
a2._x = a1._x;
a2._y = a1._y;
}
};[
本帖最后由 iswaraj 于 2008-6-30 20:25 编辑 ]