我有空洞和 d冰。
dict[box_a]=obj1_mc;
dict[box_b]=obj2_mc;
dict[box_c]=obj3_mc;
我可以把他们推向周围,把盒子 can起来。
function test_match(target,obj){
// if answer is good
if (dict[target]==obj) {
hits=hits+1;
textField.text=" Correct !!!";
obj.alpha=0.5;
// remove drag event
obj.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
obj.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
// quiz completed, all good
if (hits==max) {
textField.text="Congrats all good !!";
}
// if answer is bad
} else {
//if not good, still remove drag event
obj.alpha=0.5
obj.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
obj.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
textField.text="Incorrect";
}
//display the score so far
score_txt.text="your score is "+hits+" out of "+max;
}
This is my code. My problem is that if I take an object and put it ontop of another object(obj1_mc on obj3_mc) it will do like i put it onto the wrong box. How could I fix this please