Porting a test app from AS3 to Haxe/OpenFL (car racing game)

I am looking for someone to convert a piece of AS3 code to Haxe/OpenFL. The code is an extract from a car racing game. Before porting the whole game we want to test a small piece of it in JavaScript.

See in Flash Player what is to be ported: https://www.cyberiada.com/dragrace-preview-web/

6K code lines in 46 AS3 files, vector graphics (Flash Pro CS6), FlashDevelop project, no dependency on Starling or Feathers UI.

AS3 code does the following:

  • Loads descriptions of 3 cars from server (flash.net.Socket, raw TCP).
  • Loads text strings with fl.lang.Locale.loadLanguageXML.
  • Displays cars and UI elements using vector assets from swc files (flash.display.*).

Expected result:

  1. Haxe code compiles to both JavaScript and Flash targets.
  2. The ported app looks and acts identically to the original app for both JS and Flash targets.
  3. AS3 to Haxe conversion is automated.

Date: By the end of June.
Fee: Please give me your quote.

You can contact me here or on the company website.


Hi Fedor,

I’m not sure flash.net.Socket and fl.lang.Locale are implemented in openfl (I haven’t check it) . So you probably need to rewrite this. Vector assets are sometimes not as sharp as flash, so you probably need to use Bitmap instead depending on your results (I think that can be automated with jsfl in Flash Pro). Openfl swf lib uses its own format to read content so you can’t just use a swc, you have to compile the swf inside to the appropriate format. Openfl does that automatically but it means that some part of your code needs rewriting (a tiny portion, but it has to be mentioned).
Keep in mind that this format is heavier than swf. So if you need something light, you have to tweak that a little because I think the format is still non zipped on current release of openfl.

Furthermore, your app will not look 100% exactly the same. I give one example, you have a glow effect on your text, and as far I can tell, glow effect in openfl html5 renders not exactly the same as flash (size, color, etc.).
And finally, full automated conversion can be tricky. I know that the guys of Innogames made a lot of changes in their flash version of Forge of Empires before achieving that.

I have experience in porting a flash project in Openfl but I just wanted to put some shades and inputs in your project. Don’t hesitate to contact me if you have any questions. I’d be happy to help


Just my two cents about flash.net.Socket support : when targeting HTML5, OpenFL implements it with a Websocket (as required for this target), which is cool ; but that means the server has to support this protocol…

I can confirm this. You need Web Socket for Html5 target.

After getting initial feedback from you I want to make several comments.

  1. Full automation is not required. However, even if you don’t like as3hx you shall probably use find-replace or regexp to make the task easier and produce less mistakes. If the test app (6K code lines) is ported well then we will need to port the whole game (70K code lines). This is why I mention automation here. There should be some reasonable automation. We focus is on converting an app, not on making conversion tools fully automatic.

  2. HTML5 is indeed restricted to the Websocket protocol - good point. However, I confirm that our code uses raw TCP and the server side talks only over raw TCP.

  3. As for fl.lang.Locale, the language switch works only when the swc file is created with Flash CS6. If the same assets are compiled with Animate, then the flash runtime doesn’t want to replace strings in textfields on a call to loadLanguageXML(). I don’t expect that OpenFL will support fl.lang.Locale. I assume that the current language switching mechanism shall be replaced.

  4. Our graphic assets are mainly vector graphics, stored in XFL files and can be compiled to swc/swf.

  5. Our source code is mainly strictly typed AS3, please see a sample here.

  6. I realize that the ported app may not always look 100% exactly the same due to differences in underlying technology.

  7. If you have experience porting Flash to HTML5 then you can estimate more precisely your workload and price. As for 4K USD bid that a person has proposed, I rate it as an extremely high price for this piece of work.

So that means porting the game would also need to modifiy the server code to handle Websockets, which requires diffrent skills :slight_smile:

Hopefully this is not the only way.

Does anyone see a way to support WebSocket on the server side without modifying the existing server code which handles raw TCP?

What server do you use ? It’s very possible your server already to support websockets.

Our server does not support websockets.

What environment is your server? One potential stop-gap solution if you don’t want to modify it is create another server that translates between websockets and tcp.

1 Like

C++ software under IIS.

Did you check this project ?

Websockify is the first thing that google gives me for WS to TCP. I don’t mind using this bridge.

Do you still need someone to do this? I now have time to take on a project.

Hi Thomas,
If fact, the above test app has not been ported yet. If we come to an agreement, perhaps, you start not with that test app, but particularly with the network issue you mentioned 3 weeks ago? I’ve sent you a private message.

1 Like