1. Navigate to the following; src => _F_1 => _C_Q (If you have not refactored anything to do with this)
2. Find the code for the quit button. It should look something like this (mine is refactored to make it look pretty
)
Code:
this.quitButton = new _H_o(homeScreenButtons.QUIT, 22, false);
3. Replace the whole block of code with (If not refactored):
Code:
this._8k = new _H_o(_0M_1.QUIT, 22, false);
this._8k.addEventListener(MouseEvent.CLICK, this.onQuitClick);
//this._8k.visible = (Capabilities.playerType == "Desktop");
4. Then you want to make the event handler... or ofcourse you could generate it but w/e;
Code:
private function onQuitClick(event:MouseEvent):void{
if(Capabilities.playerType == "Desktop")
{
NativeApplication.nativeApplication.exit(0); // For closing with the debugger.
}else
{
fscommand("quit"); // For closing with the actual .swf
}
}
Don't forget to import flash.desktop.NativeApplication & flash.system.fscommand;
5. You're done.