用滑鼠可以拖曳黃色和綠色的平行四邊形,拖曳到正確的相對應框框裡,就會顯示 Ture,差太多就顯示 False。程式碼如下:
[@more@]
left_move
.addEventListener(MouseEvent.MOUSE_DOWN, movieleft
);left_move
.addEventListener(MouseEvent.MOUSE_UP, Stopleft
);right_move
.addEventListener(MouseEvent.MOUSE_DOWN, movieRight
);right_move
.addEventListener(MouseEvent.MOUSE_UP, movieStop
);
right_move.startDrag(true);
} //右邊拖曳
left_move.startDrag(true);
} //左邊拖曳
{
right_move.stopDrag();
txt
.text =
String(right_move
.hitTestPoint(right1
.x,right1
.y,true)) ;}
//滑鼠放開時停止拖曳,並偵測是否碰撞
{
left_move.stopDrag();
left_txt
.text =
String(left_move
.hitTestPoint(left1
.x,left1
.y,true)) ;}