OpenFl with npn vs HaxeLib installation?

Hello guys, what is the difference between OpenFf installed by npn and installed with Haxelib? Is there a real difference? I plan to develop under Flashdevelop. I had already made tests a few months ago and I am coming back. OpenFl realy use AS3 Framework? Because i like very much AS3 language :heart_eyes:
Is its development active enough?

Hello, I can’t comment much on NPM but my understanding is that it’s meant to be used with javascript/typescript. If you are coming from as3/flash you probably want to go with haxelib.

OpenFL replicates the flash API but uses haxe language. Haxe is very similar to as3 with some differences that you can learn about here https://books.openfl.org/as3-conversion-guide/comparing-haxe-and-actionscript/

When compiling to flash/air, OpenFL will use flash classes directly so an openfl.display.MovieClip will become a flash.display.MovieClip for example.

Haxe has a lot more to offer than as3 though, there is some voodoo stuff that you can ignore at first but could be useful if you need it at some point.

OpenFL is under active development with regular updates, there are currently some changes going on about how it is organized but nothing to worry about in my opinion.

1 Like

@Matse, thank you for this info ! :wink: what interests me is being able to make applications that can run on windows and possibly mobile; But above all on the WEB which in this case can really work everywhere! I will see what I can do with OFL haxeLib and OFL NPM … I don’t know if we can install both versions in parallel on my machine … Again Thank you for your answer.

You’re welcome, glad I can help !

You can do all this with the haxelib version of OpenFL, which is the historical version. In my understanding the NPM version is a quite recent effort to attract JS devs.

Once you have Haxe installed you can open a command window and type

haxelib install openfl

it will install and setup OpenFL on your computer along with dependencies such as Lime, on which OpenFL currently sits.

I don’t think you need anything else to target html5

For desktop you will need to install hxcpp from haxelib (again in a command window) :

haxelib install hxcpp

you will also need to install software that will handle the c++ compilation process. On windows that will typically be visual studio community edition.

By the way it’s a difference compared to AIR : you will need to build on windows for a windows version of your app, on linux for a linux version and on mac for a mac version.

For android you will have to install the android sdk, for iOS you will need xcode (and a mac)

Another possibility for desktop that I have yet to try is Hashlink but my understanding is that right now it’s a bit tricky to use with OpenFL, should be sorted out in the near future.

About IDEs you can use flashdevelop, haxedevelop, the best one seems to be Visual Studio Code but the install and setup process is a bit unclear to me I only used it with Heaps (another haxe framework dedicated to games) so can’t comment on it with OpenFL

Also you can target flash/air, which is a good thing for rapid testing and debugging in some cases.

edit : “targetting” a platform is typically just selecting it in a dropdown list from your IDE, with the limitations I mentionned (on windows the only desktop target will be windows, maybe hashlink is cross platform I didn’t look into it yet but I think it’s a modern Virtual Machine so that sounds possible)

1 Like

don’t forget haxelib run openfl setup :wink:
(here is also little overview about the 2 ways: https://www.openfl.org/download/)

1 Like

Oh yeah :slight_smile: I don’t do that often, forgot ^^

Also lime setup is gonna install hxcpp automatically I think, and openfl setup will run lime setup, right ?