你只有返回的判定代码
应该再补一段
on(press) {
//按下鼠标
startDrag(this,true) ;
//拖动这玩意
var ax = this._x;
//用ax记录当前a的x坐标
var ay = this._y;
//用ay记录当前a的y坐标
}
on(release) {
//松开鼠标
stopDrag();
//停止拖动
if ( ! this.hitTest(_root.b )) {
//如果它和B位置不重叠
this._x = ax ;
//就让它的X坐标回到A的位置
this._y = ay;
//就让它的Y坐标回到A的位置
}else{
//如果和B重叠了
this._x = b._x;
this._y = b._y;
//a的坐标就等于b的坐标了
//这样它就不会返回啦
}
}