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:

npm install -g yo generator-openfl

This workflow supports TypeScript, Haxe, ES6 JavaScript or ES5 JavaScript-based development, but it is not designed to cross-compile to native desktop or mobile targets.

mkdir NewProject
cd NewProject
yo openfl

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):

git clone https://github.com/openfl/openfl-samples-ts
cd openfl-samples-ts/features/display/DisplayingABitmap
npm install
npm start

Next Steps

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:

haxelib install openfl
haxelib run openfl setup

In order to check if OpenFL has been installed properly, try running the openfl command:

openfl

Run a Sample

You can use the "openfl create" command for a list of available samples.

openfl create

For example, here is how to build and run the DisplayingABitmap sample on HTML5:

openfl create DisplayingABitmap
cd DisplayingABitmap
openfl test html5

Next Steps

Now that OpenFL is installed, you can choose a code editor or learn how to use OpenFL by creating your first project.

Problems?

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.