Hello everyone!

The idea of an OpenFL code sandbox is something that has bounced for a long time. After we first released OpenFL on NPM, this idea resurfaced again, since the NPM release of OpenFL (and being included on JS CDNs) really makes it much simpler to begin playing with OpenFL without installing Haxe or anything else client-side.

We’ve chosen an online service called “CodeSandbox” to host a default template for ES6 JavaScript with the OpenFL NPM release. It’s the same OpenFL you know and love from Haxelib, except written for access from TypeScript, ActionScript (using Apache Royale), JavaScript and even Haxe still, but with no access to the Lime API, and support in the browser only (unless you write in Haxe and use your source from both versions of OpenFL).

I’d like to invite you to give it a try, and let us know how we can improve and make it easier to use to create and share OpenFL code. Bear in mind, being in the browser, there are cross-origin security conditions on loading many images, but otherwise this is a great way to start writing OpenFL code (or sharing OpenFL code) right away!

Here’s a quick example:

Note: This may work better in Chrome or Opera than Firefox

EDIT: Here’s another two that were shared on the OpenFL Discord channel :grin:


This is absolutely great, too bad that it doesn’t run in Firefox though !


Hopefully they’ll sort that out, otherwise, we can switch to another service if we find a better one :slight_smile:


Wow, that’s so cool! You’re not resting for a second.
All the examples are of js, will it allow writing haxe code eventually?


We’re looking at ways to use Haxe in an environment like this, though I really like the live-coding environment we can get when using JavaScript since it’s already running in the browser.

I think that we’ll be able to find a way to get it working using CodeSandbox or another service (, etc) using a server configuration.

Here’s a very basic test I wrote that is running Haxe, but its not convenient to re-reun (I have to hit “Server Control Panel” on the left side, then “Restart Sandbox” each time the Haxe code changes :slight_smile: )


Pretty cool, but unless it’s not working for me as intended (I’m on Chromium under Linux Mint 19), I’d suggest the default example app do just a tiny bit more than log to the console, like perhaps display an image.

Here’s what I see initially:

Only after clicking the Console tab at the bottom do I even know that it did something–much more eye-catching is the big empty browserish subwindow that makes one think that maybe it’s not working.


I wanted to leave it pretty clear for any type of experiments, but I think you are right, that perhaps it is a little too sparse to know that it is truly working. Plus, working with an image (with none available) makes it harder to add one the environment.

Here’s an updated template, let me know what you think?


Much better, in my opinion! Thanks for the quick response!