All pastes #689096 Raw Edit

Something

public text v1 · immutable
#689096 ·published 2007-09-09 20:46 UTC
rendered paste body
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"), []);
}