MC 子级上的 hitTestObject
我有一个名为“playerP”的 MC,里面有 7 个不同的 MC。我似乎无法对子 MC 进行测试,它总是显示 [objectposition_2]
private function cMove(e:MouseEvent):void
{
trace(MovieClip(playerP.RR), playerP.PT)
if (e.currentTarget.hitTestObject(playerP.PT))
{
trace("hit la");
}
}
I have a MC called 'playerP" and inside of it with 7 different MC. I can't seems to hit test on the children MC, it always show [object position_2]
private function cMove(e:MouseEvent):void
{
trace(MovieClip(playerP.RR), playerP.PT)
if (e.currentTarget.hitTestObject(playerP.PT))
{
trace("hit la");
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我正在尝试引用一个具有 2 个图层和 2 个实例引用的影片剪辑。
一个叫埃里克,另一个叫热门。目前较大的Erik正在工作,我怎样才能使“命中”成为目标。
这有效,但对 Erik 来说是有效的
,因为 Erik 是一个类对象。
I am trying to reference a movieclip that has 2 layers and 2 instance references.
One is called Erik, the other hit. Currently the larger Erik is working, how can I make 'hit' be the target.
This works but on Erik which is set by
as Erik is a class object.
尝试明确地迭代子级。
Try explicitly iterating through the children.