Clicking Through a Sprite in Flex/Actionscript
I ran into a problem recently where I wanted to add a rectangle to the stage but still wanted users to be able to click through it. Here’s a solution I found:
private function addClickThroughSprite():void
{
overlay = new Sprite();
overlay.graphics.beginFill(0xFF0000,0.2);
overlay.graphics.drawRect(0,0,width,height);
overlay.graphics.endFill();
overlay.hitArea = new Sprite();
rawChildren.addChild(overlay);
}
Basically you set the sprite hit area to a blank sprite, which exposes the components beneath. If anyone has a better solution feel free to share it.