Daniel A. White
Daniel A. White

Reputation: 190941

Allow button click through layer in Flash/ActionScript3

I have the following layer structure in Flash:

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;
}

Upvotes: 2

Views: 3539

Answers (1)

Daniel A. White
Daniel A. White

Reputation: 190941

While looking something else up, I found this.

Spotlight.mouseEnabled = false;
Spotlight.mouseChildren = false;

Upvotes: 7

Related Questions