Haxe in FlashDevelop2

FlashDevelop 2

Haxe FD is a Plugin for the FlashDevelop IDE.

IMPORTANT : The Haxe FD plugin only works with FlashDevelop 2.x.x.
FlashDevelop 3 has built-in support for Haxe and does not require the Haxe FD plugin

To install haxeFD, you need first to download and install Haxe, then use the following command :

  haxelib install haxefd

This will install haxefd in the haxelib repository. Now in order to complete installation, you need to go to your haxelib repository directory to run the install script :

  haxelib run haxefd [path-to-flashdevelop]

This will install Haxe FD for FlashDevelop. This command has an optional directory argument which is your FlashDevelop installation directory (by default it's c:\program files\flashdevelop).

Using haxeFD

Once installed, you will notice some modifications in your FlashDevelop Menus.

A new Haxe Project Menu :

haxefd_menu.png

And new panels in the View Menu :

haxefd_view.png

Creating a New Project

Create a new Project, this will create a single .hxp file which stores the project properties. Use the View FlashDevelop menu to display the Haxe Project Panel :

haxefd_project.png

The project manager allows you to create one or more Target for your project. This way you can compile several files in one single time. Right click on the Target list and Select Add Target. Give it a name to identify it.

By clicking on it, it will display its Properties. Enter an output file and select your Platform. If you are compiling for Flash, you can select an assets SWF Library.

Select a Class that will be the one compiled by Haxe.

If this class have a main function that you want to call when the application starts, check the corresponding property.

You can add more classes and additional parameters in the Extra Parameters list (one per line).

Adding Files

Now, let's open the Haxe Sources Panel by using the View menu :

haxefd_sources.png

You can add there your files and create virtual folders to sort them. The directory structure of your project does not need to match the one on your hard drive, so you can organize your files the way you prefer.

Please note that even if you included a file in the Haxe Sources, if it's not used by your Project Target, it will not be compiled.

Compiling and Testing

Hit the F8 key to compile. If you did setup your Project correctly, it should run the Haxe compiler and output the eventual errors in the Output or Results panel. Please check those two. The Output panel should display Done(0) in blue after executing Haxe successfully. The Result panel will capture Haxe syntax and type errors so you can click on it to access directly to the file/line it occurred.

When compiling a haxeFD project, a .hxml file will get generated with the options you have been selecting for your targets. It will enable other people that don't use haxeFD to compile your project directly.

You can now start your project with F5. By default, this will execute your Output file for the default Target. If you want to execute another file, for example open an HTML file or browse a given location, you can change the Test Cmd value in your Project Target.

Completion and CodeTips

Completion is supported for both fields and packages accesses, as the screenshots below shows :

haxefd_codetips.png

haxefd_codetips2.png

Since the compiler is used for completion implementation, the class you are currently editing must be compiled as part of your project, and some syntax errors might prevent you to see completion tips (in that case the syntax error is displayed instead).

Contributing haxeFD

If you want to contribute haxeFD, please visit the Project Page. You'll be able to checkout the sources and start playing with it

version #8629, modified 2010-06-09 13:02:51 by baurel