What is the difference between openfl "Next" and "Legacy"?

Hi, is not clear enough for me,
what is the difference between openfl “Next” and “Legacy”?

Where should be used one or the other,
and how do you set it (in flashdevelop) ?

thanks in advance…

I just googled that for you. :smile: Seems like this page answers all your questions: http://www.openfl.org/blog/2015/04/08/openfl-hybrid-release/.

Thanks, i will check it!

OpenFL 1.0 had different libraries for different backends. “openfl”, “openfl-native”, “openfl-html5” worked in tandem to provide different platforms targets.

OpenFL 2.0 unified to a single “openfl” library, using “native” and “html5” directories internally. Later on, OpenFL 2.x releases a “next” version that unified the targets under one codebase. This was available using “-Dnext”

OpenFL 3.0 is unified as a single OpenFL library, with one codebase. OpenFL next is OpenFL 3.0. All platforms use one codebase over Lime 2.

OpenFL 3 includes a “legacy” path, which is the “openfl-native” from 1.x and 2.x, plus minor edits to continue to provide support (but not ongoing development) of the old codebase.

In this way, OpenFL 3 is the same code on HTML5, as it is on native, on mobile, desktop, and upcoming console support. OpenFL 3 uses Lime 2, and has full access to its API features, which are more flexible and powerful than the old native codebase.

You can edit the platform target drop-down in FlashDevelop, this (in my opinion) is the easiest way to switch. Click in it and change “windows” to “windows -Dlegacy” (for example), and FlashDevelop adds the additional entry to your list. Now you can switch at will :smile:

The goal is to continue to make OpenFL 3 better and more mature, until legacy is no longer needed


Thanks, great explanation :smile:
Just one problem, in flashdevelop the drop-down list only says the target names:
“html5”, “flash”, “windows”, “neko” “android”, “tizen”, “blackberry”, “webos”

i think you must use the project.xml and add something like:
<set name="openfl-legacy" />
<set name="D-next" /> or something like that?
not really clear which one is default or what string should i use (-dnext , hybrid, openfl-legacy, etc)

The drop-down is editable – you can add new targets, or add targets with defines specified (like “windows -Dlegacy” if you want)

I would not recommend using hybrid, though – I think using the new code entirely is a better bet than trying hybrid nowadays :slight_smile:

if i don’t use any additional parameter, which one is set as default, the “Next” version?

OpenFL 2.x has a “next” (-Dnext), OpenFL 3.x has a “legacy” (-Dv2 or -Dlegacy)

If you use HaxeFlixel, it forces legacy by default on OpenFL 3, and re-introduces -Dnext to turn it off. OpenFL 3 has no next.