NPM (Option 1)
If you would like to use OpenFL for a web-based project, using NPM and modern web development tools, you can get started by installing Yeoman, then generating a new OpenFL project:
Run a Sample
There are many OpenFL samples you can try, depending on the code environment you wish to use:
Choose a sample, then
npm install and
npm start in the local directory to start a development server (with hot-reloading enabled):
If you do not have a code editor already, Visual Studio Code is a good choice for that integrates well with OpenFL and NPM.
Haxelib (Option 2)
OpenFL is also available on haxelib, supporting HTML5, native desktop, mobile, AIR and Flash development from a single toolset and the Haxe programming language. To get started, install Haxe globally on your system:
With the latest versions of Haxe and Neko installed, open a command-prompt (Windows) or terminal (macOS/Linux) and run these commands:
In order to check if OpenFL has been installed properly, try running the
Run a Sample
You can use the "openfl create" command for a list of available samples.
For example, here is how to build and run the DisplayingABitmap sample on HTML5:
If you have any questions or concerns when you are installing OpenFL, do not hesitate to visit our friendly community forums. Thank you for trying OpenFL, and please let us help if you have any problems at all.