views:

179

answers:

1

I have the following layer structure in Flash:

  • Spotlight - Has a transparent center area, is a bitmap symbol
  • Button

How do I make Button clickable even though the Spotlight layer? I want to toggle the visibility of the Spotlight layer with the click of Button like the following code.

Button.addEventListener(MouseEvent.MOUSE_CLICK, OnClick);

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

While looking something else up, I found this.

Spotlight.mouseEnabled = false;
Spotlight.mouseChildren = false;
Daniel A. White