SimpleButton constructor

SimpleButton(
  1. [DisplayObject? upState,
  2. DisplayObject? overState,
  3. DisplayObject? downState,
  4. DisplayObject? hitTestState]
)

Creates a new SimpleButton instance.

Any or all of the display objects that represent the various button states can be set as parameters in the constructor.

Implementation

SimpleButton(
    [this.upState, this.overState, this.downState, this.hitTestState]) {
  useHandCursor = true;

  onMouseOver.listen(_onMouseEvent);
  onMouseOut.listen(_onMouseEvent);
  onMouseDown.listen(_onMouseEvent);
  onMouseUp.listen(_onMouseEvent);

  onTouchOver.listen(_onTouchEvent);
  onTouchOut.listen(_onTouchEvent);
  onTouchBegin.listen(_onTouchEvent);
  onTouchEnd.listen(_onTouchEvent);
}