on (press) {//按下鼠标
startDrag(_parent, false, 50, 50, 350, 550);//使图块可以在一定范围内被拖拽
}
on (release) {//释放鼠标
stopDrag();//停止拖拽
for (i=1; i〈=12; i++) {//判断图块所在位置
if (_parent._x〈=eval("_root.b"+i)._x+40 and _parent._x〉=eval("_root.b"+i)._x-40 and
_parent._y〈=eval("_root.b"+i)._y+40 and _parent._y〉=eval("_root.b"+i)._y-40) {
//如果被拖拽的图块中心点进入某个判断位置的MC的范围内时
_parent._x=eval("_root.b"+i)._x;//设置图块的坐标,使其吸附到相应的位置
_parent._y=eval("_root.b"+i)._y;
里面运行的时候老师出现一些错误
|