var carrotList = [s.instance_25, s.instance_29, s.instance_28, s.instance_27, s.radish_5, s.radish_6, s.radish_7, s.radish_8, s.radish_9];
for(var i = 0; i < carrotList.length; i++) {
console.log(carrotList[i])
carrotList[i].mouseChildren = false;
//拖拽
carrotList[i].addEventListener("mousedown", function(e) {
console.log(‘mousedown‘);
oldX = e.stageX;
oldY = e.stageY;
});
carrotList[i].addEventListener("pressmove", function(e) {
console.log(‘move‘);
e.target.x += e.stageX - oldX;
e.target.y += e.stageY - oldY;
oldX = e.stageX;
oldY = e.stageY;
});
}
s.instance_26.addEventListener("click", submit)
// 判断区域
function submit() {
var boxAreaW_1 = s.box_1.x;
var boxAreaH_1 = s.box_1.y;
console.log(boxAreaW_1)
console.log(boxAreaH_1)
console.log(s.instance_25.x);
console.log(s.instance_25.y)
if(s.instance_25.x <= (boxAreaW_1 + 270.05) && s.instance_25.x >= (boxAreaW_1) &&
s.instance_25.y >= (boxAreaH_1) && s.instance_25.y <= (boxAreaH_1 + 200.05)) {
s.gotoAndPlay(‘zq‘)
} else {
s.gotoAndPlay(‘cw‘)
}
}