黄土高坡电子琴伴奏:续:拖拽图形后跟着鼠标走的问题

来源:百度文库 编辑:中科新闻网 时间:2024/04/27 21:59:21
请cxxssy继续来解答^-^

n = 1;
m = 1;
depth = 0;
_root.obj.onPress = function() {
flag = 0;
_root.obj.duplicateMovieClip("obj"+n, depth++);
_root["obj"+n].startDrag();
};
_root.mc.onPress = function() {
flag = 1;
_root.mc.duplicateMovieClip("mc"+m, depth++);
_root["mc"+m].startDrag();
};
_root.onMouseUp = function() {
switch (flag) {
case 0 :
_root["obj"+n].stopDrag();
n++;
break;
case 1 :
_root["mc"+m].stopDrag();
m++;
break;
}
};
场景上两个剪辑,名字分别为:mc和obj