Migrating Flex Application to Haxe and OpenFL using AS3HX

450 views
Skip to first unread message

Imane

unread,
Nov 1, 2016, 5:48:14 AM11/1/16
to Haxe
Hello Folks, I am new to OpenFL and Haxe, and i have some questions regarding migration from Flex to Haxe. We find it weird that despite of the good performance of OpenFL and the availability of AS conversion tools to Haxe like AS3HX, nobody seems to be able to use the Flex framework in OpenFL and Haxe.
What are the sticking points that prevent this migration, which enables Flex applications to be executed on HTML5 ?

Phillip Chertok

unread,
Nov 1, 2016, 12:54:38 PM11/1/16
to Haxe
You're not going to be able to just convert a Flex project that way.  The flex framework is not going to be able to be compiled into JS and just work (unless someone knows something I don't).

You might want to take a look at https://nextgenactionscript.com/ - there are tools there for migrating from As3 to Javascript.  The Apache Flex SDK now can output javascript so if you can convert your project so that it works with that you might be ok.

There is another 

Imane

unread,
Nov 1, 2016, 1:55:03 PM11/1/16
to Haxe
Thanks Philip for your answer 
In fact, yes there are some tools to generate JS code from AS, we have been working with FlexJS. it is good but it has some limitations like (AMF/Weak References/ changing variable's name) and also he can not generate Flex classes that depends on Flash. That's why we want now to test Haxe (it's possible to generate JS files from HX  files https://haxe.org/manual/target-javascript-getting-started.html) using as3hx to convert AS3 files to HX and replace flash dependencies with OpenFl.

PSvils

unread,
Nov 1, 2016, 2:27:11 PM11/1/16
to Haxe
While it should be easy to convert a Flash project to OpenFL, converting an AIR project, or even Flex, is much harder.
I'm not sure on OpenFL's support of the AIR API and features, but I think/would assume it's much less than the standard Flash one. (I do recall it having several similar APIs though)
Flex is a big, hunky piece of assets, and this I don't think there is any support for. So if you depend on Flex, be ready to explore alternative UI frameworks from the Haxe world, unless you start to port over the framework into something that could work with OpenFL.

But yeah, porting a Flex project sounds like a huge task, and is very different from porting a Flash/AIR project.

hosey hosey

unread,
Nov 1, 2016, 3:38:23 PM11/1/16
to haxe...@googlegroups.com

Haxeui has a XML based layout similar to flex mxml.  We are testing v2.  It would be a manual conversion of mxml to haxeui XML and has some works but is generally pretty solid.


--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.

Imane

unread,
Nov 3, 2016, 8:16:38 AM11/3/16
to Haxe
Thanks hoseyhosey for your reply
Haxeui seems great, is there any dynamic way to migrate MXML files to Haxeui (because doing it manually is very complicated we have a lot of screens / MXML files) ?

Andre Lacasse

unread,
Nov 3, 2016, 9:07:11 AM11/3/16
to Haxe
For FlexJS, you can convert mxml and as3 to JS but ... a lot of features are not availables : mx package, spark package, resource manager and BytesArray. FlexJS use google closure for JS compilation and is more strict for circular dependancies.

Imane

unread,
Nov 3, 2016, 12:15:55 PM11/3/16
to Haxe
Yes indeed, FlexJS has lot of limitations 

Here is what we want to do to migrate our Flex Application to Haxe : 

1- Replace Flash Dependecies in Flex classes (AS Files) by OpenFL 

2- Convert MXML files to AS with MXMLC compiler (option: keep-generated-actionscript) 

3- Convert all AS files to HX (with as3hx library)


Do you think that one of these steps is simply too expensive to be attempted ? do openfl cover all flash classes used by Flex ?

hosey hosey

unread,
Nov 3, 2016, 1:03:17 PM11/3/16
to haxe...@googlegroups.com

Not likely, no.  We went the "from scratch' direction

Reply all
Reply to author
Forward
0 new messages