public function new () {
Reflect.setField(flash.Lib.current, "start", start);
Reflect.setField(flash.Lib.current, "reset", reset);
Reflect.setField(flash.Lib.current, "quit", quit);
}
// now these methods get called from the master film:
public function start () { /* application start code */ }
public function reset () { /* application reset code */ }
public function quit () {
// a small hack to call the GameManager.gameDone method:
var func = Reflect.field(Type.resolveClass("com.casualgameplay.cgdc.GameManager"), "getInstance");
var gm = Reflect.callMethod(Type.resolveClass("com.casualgameplay.cgdc.GameManager"), func, []);
Reflect.callMethod(gm, Reflect.field(gm, "gameDone"), []);
}