允许按钮单击Flash / ActionScript 3中的图层

时间:2009-09-26 15:45:01

标签: flash actionscript-3 events

我在Flash中有以下图层结构:

  • Spotlight - 具有透明中心区域,是位图符号
  • 按钮

即使Button图层,如何使Spotlight可点击?我想通过点击Spotlight来切换Button图层的可见性,如下面的代码所示。

Button.addEventListener(MouseEvent.MOUSE_CLICK, OnClick);

function OnClick(e:MouseEvent):void
{
   Spotlight.visible = !Spotlight.visible;
}

1 个答案:

答案 0 :(得分:7)

在寻找其他东西时,我发现了这一点。

Spotlight.mouseEnabled = false;
Spotlight.mouseChildren = false;
相关问题