我正试图将此安全带对象移动到水平面上。我发布了迄今为止我所做的。它并不真正解决问题,因为它好像就像我按下按钮时安全带只能朝右侧移动并且MOUSE_UP
不起作用。有人能指导我如何去做这件事吗?需要将此对象向一个方向移动
seatBelt.addEventListener (MouseEvent.MOUSE_DOWN, prsing);
seatBelt.addEventListener (MouseEvent.MOUSE_UP, lfting);
seatBelt.addEventListener (MouseEvent.MOUSE_MOVE, mving);
function prsing (e:MouseEvent){
posX= seatBelt.x ;
posY = seatBelt.y ;
mouseclick = 1;
}
function mving (e:MouseEvent) {
if (mouseclick == 1) {
seatBelt.x = mouseX ;
}
}
function lfting (e:MouseEvent){
seatBelt.x = posX;
seatBelt.y = posY;
mouseclick =0;
}
非常感谢它,真是太棒了! – tailedmouse 2013-03-27 01:57:50
@taildmouse没问题:) – Allan 2013-03-27 01:59:20