All pastes #958129 Raw Edit

Miscellany

public text v1 · immutable
#958129 ·published 2008-03-26 14:37 UTC
rendered paste body
class Button extends flash.display.SimpleButton {

  public var onClick : Void -> Void;
  public var onMouseOut : Void -> Void;

  public function new ( graphic : String ) : Void {

    onClick = doOnClick;
    super ();

    upState = new Image ("gfx_" + graphic + "_up");
    downState = new Image ("gfx_" + graphic + "_down");
    overState = new Image ("gfx_" + graphic + "_over");

    hitTestState = overState;
  }

  public function setLabel (text : String) {
  }

  public function doOnClick () {
  }
}

=============================================================

var foo:Button = new Button ('leftPaneItem');
addChild (foo);