【问题标题】:How to pass mouse clicks through TLF text?如何通过 TLF 文本传递鼠标点击?
【发布时间】:2012-01-02 06:56:21
【问题描述】:

.mouseEnabled 不像在通常的 MovieClip 上那样工作。怎么了?

【问题讨论】:

    标签: actionscript-3 textfield tlf


    【解决方案1】:

    尝试将selectablemouseEnabledmouseChildren 和傻笑mouseWheelEnabled 全部设置为false

    【讨论】:

    • 非常感谢!这个问题一直困扰着我一整天!我发现您需要 mouseEnabled 和 mouseChildren。启用似乎只会禁用鼠标与文本的交互,而子项会影响文本周围的整个命中框,但不会影响文本本身。
    【解决方案2】:

    使用

     text_field.mouseEnabled = false;
     text_field.mouseChildren = false;
    

    mouseChildren 表示它的子级不注册鼠标事件,它们只是从父级分派。要完全禁用它,两者都需要为 false。

    由于文本字段是影片剪辑的子字段,因此 mouseChildren 属性会对其产生影响,您只需将其设置为 false 即可。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-07-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多