MbButton extends SimpleButton

use | constructors | others | get/set

Use

 

 

Constructors

MbButton(txt_:String, w_:int, h_:int)

static makeButton(placeHolder:DisplayObject, txt:String,
container_:DisplayObjectContainer, handler_:Function):MbButton {

replace placeholder with a button
container must be supplied -- usually "this"
handler should be defined separately and name passed

static makeButtonAt(xx:int, yy:int, txt:String,
container:DisplayObjectContainer, handler:Function):MbButton

to create button without placeholder
button size is determined by length of text

Other Functions

changeLabel(txt_:String)

change the text of button

 

public function changeHandler(newHandler:Function) {

remove old handler, attach new handler

Getters/Setters

getLabel():String

MbHintButton extends MbButton

easy way to add a button with a predetermined set of hints

 

var h:MbHintButton = MbHintButton.makeButton(plaHintBut, hintTF, this, "I don't get it");
h.addHint("first hint");
h.addHint("another hint");

 

2 Constructors and 1 Method

makeButton(placeHolder:DisplayObject, phHintSpace:TextField,
container:DisplayObjectContainer, txt:String="?"):MbHintButton

requires a placeholder and textfield on the stage

pass "this" for container if stage is the container, otherwise pass the name of the "board"

MbHintButton(phHintSpace:TextField, txt:String="?", w_:int=20, h_:int=20)

no placeholder, but still need a textfield

user must addChild

addHint(hint:String)

hints must be added in desired order