Hi all,
Let's say I want a Sprite to act as a button and I want this Sprite to be able to be disabled. Like so:
public class Button extends Sprite
{
private var _disabled:Boolean = false;
public function get disabled():Boolean
{
return _disabled;
}
public function set disabled( disable:Boolean ):void
{
_disabled = disable;
}
}
and then somewhere I do:
var myButton:Button = new Button();
myButton.addEventListener( MouseEvent.CLICK, _someClickHandler );
then when I disable the button like so:
myButton.disabled = true;
... how can I make it, so that my Sprite doesn't fire of a MouseEvent.CLICK? Or should I perhaps rethink my design?