-1
好的问题是,我只是想让一个球体在它接触我的十字准线时才消失,问题是无论十字准线是否触及它,球体都会消失。as3 hittestobject会在没有运行参数的情况下激活
我的符号是:
十字线与十字线的一个实例在舞台上
目标与targetBlue的实例在舞台上
Mouse.hide();
crossHair.startDrag(true);
stage.addEventListener(MouseEvent.CLICK, _onStageMouseDown);
function _onStageMouseDown(e:MouseEvent):void
{
if (crossHair.hitTestObject(targetBlue), true)
{
targetBlue.visible = false;
trace("the mouse is in the target");
} else if (crossHair.hitTestObject(targetBlue), false){
trace("the mouse is not in the target");
}
}
在adobe中只有一个代码片段,我设法使用它。但是我想出了问题。我将鼠标事件从舞台更改为符号 –
问题在于鼠标似乎无法与相邻和下方的图层进行交互。 –