How to exit Haxe/OpenFL program?

这一生的挚爱 提交于 2019-12-04 04:05:11

It depends on the compilation target: I'm going to assume you're compiling to CPP (Windows EXE). In which case you should just be able to use the following:

import flash.system.System; // Or nme.system.System if you're using NME

...

// in your FlxButton callback:
System.exit(0);

I can't test right now so I don't know what effect this would have in Flash (i.e. you may have to wrap it in a conditional compilation flag for cpp), but I do know that it won't work for iOS.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!