Getting Started

Install NPM

NPM is included by default with Node.js, but may be out-of-date. Update NPM by running the following command:

npm install npm -g

You may have to run this using sudo on Linux or macOS.

Install a Code Editor

Next, you should make sure that you have a code editor that is designed for TypeScript, Haxe or at a minimum, syntax highlighting for JavaScript. There are many choices, but if you are unsure, we recommend you start with Visual Studio Code.

Creating a New Project

The simplest way to get started with OpenFL is to use a generator to make a new project:

You will have the opportunity to choose TypeScript, Haxe, ES6 or ES5 as the source language (or syntax) for your new project.

Running Your Project

The default project template is configured with a “hot reload” development server. You can start a development server by going to the root directory of your project, and running npm start. In addition to compiling your application, it will open a new window in your web browser, with hot reloading enabled. This means that if you edit the app.ts, app.js or App.hx source file, the server will automatically compile your changes, and reload the current window, speeding up development.

Making Some Changes

Open your code editor and select “Open Folder”, then open the new project directory we created. Otherwise, if there is no option to open a folder, edit “src/app.ts”, “src/app.js” or “src/App.hx” by itself.