flash - AS3 - 让鼠标针对 child 一层深

标签 flash actionscript-3

我只想找到第一级的 child 。现在我正在使用 e.target.name 但这也捕获了那些目标子项。我该如何防止这种情况发生?

最佳答案

我看到三种可能性:

  • 将所有一级子级设置为 mouseChildren=false。
  • 将事件直接链接到子级并使用 currentTarget。
  • 遍历目标的层次结构,直到找到正确的父级:

像这样:

var clip:DisplayObject=e.target;
while(clip.parent!=e.currentTarget) {
    clip=clip.parent;
}

关于flash - AS3 - 让鼠标针对 child 一层深,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4780459/

相关文章:

html - 与其他 HTML 重叠的 Flex 影片

javascript - 简单的闪光检测

flash - Flash 上的跳帧

Facebook 操作脚本 3 API 登录/注销问题

ios - 如何在 Windows 上调试 iPad Flash 应用程序?

ios - 在iOS上获取软键盘以显示在Pure AS3移动项目中(flex 4.5)

actionscript-3 - 在 Actionscript 3 中将键码转换为字符串

ios - 无法在 IPAD 上安装我的应用程序(卡住在 "installing")

flash - wmode=transparent 对于 Youtube 视频 Iframe 无法在具有 Bootstrap 模式的 IE 中工作

android - 重叠的声音Actionscript 3/AIR