Beginner: Does anything work?

Tried Haxe, HaxeDevelop, OpenFl, Lime, today. Can’t get anything to work. Does anyone have a link to a “Getting Started” post that actually works today?

I have several years of FlashDevelop, captive runtime Air projector, development experience. I downloaded and installed Haxe (haxe-4.2.0-win64.exe), HaxeDevelop (HaxeDevelop-5.3.3.exe). HaxeDevelop sees that version of Haxe as 4.1, but I figure FlashDevelop had issues like that too. (Actually uninstalled and re-installed HaxeDevelop a few times)

I tried the steps at:


and

I create and try to test it and I get errors like:
lime._internal.backend.html5.HTML5WebGL2RenderContext should be lime.graphics.WebGLRenderContext

I tried at least one other OpenFl sample too.

When I open samples in HaxeDevelop–both Haxe exmples and OpenFl I get errors on everything I try.

I try command line

lime install openfl
openfl is up to date
lime is up to date
hxcpp is up to date
lime-samples is up to date
openfl-samples is up to date
actuate is up to date
box2d is up to date
layout is up to date

I’ve installed libraries with Haxelib as directed by error messages in HaxDevelop.

I’ve seen errors when trying to test to flash like: “openfl.Utils.ByteArray should be haxe.io.Bytes”

I try to test to neko, and get “lime.utils.Float32Array should be lime.utils.DataPointer”

I’ve seen errors like “@:fakeEnum enums is no longer supported in Haxe 4, use extern enum abstract instead”

I’ve tried multiple project types in HaxDevelop, but OpenFl is the reason for trying Haxe.

Can anyone point me to a link to getting started with OpenFl that has a simple step through, with proper versions of Haxe, Lime, and OpenFl, that actually works? I’d be happy to uninstall everything and start over, or switch to VSCode if that helps (which I guess is what I need to do anyway for decent debugging).

There must be such a thing, it seems like plenty of developers are using OpenFl with Haxelib. That would get me rolling much faster than what I’m trying now.

I’m not a guru, but I’m not a complete idiot either (at least I don’t think I am).

Thanks for reading.

Sorry you’re having problems. Haxe recently updated to 4.2. openfl and lime aren’t compatible yet. The solution for now is to downgrade haxe to 4.1.5. If you’re building to windows, you’ll need to also downgrade hxcpp to 4.1.15.

hope it helps.

1 Like

Thank you.

Figured it was probably something like that.

That should help a ton! I will try tomorrow.

Also you could download FlashDevelop (HaxeDevelop) latest development build from https://flashdevelop.org/downloads/builds/
They are stable and contains many new features and fixes

1 Like

Sorry for the slow response, but wow. What a great link. I had no idea. On the FlashDevelop and HaxeDevelop websites the latest versions I found were from February of 2018 and found no chatter of of more recent versions… Who knew? Well, other than you of course.

Thank you.

I was able to get some stuff working, but not much so far. Definitely a “slog through it” process. But still have great appreciation that OpenFl, Lime, FlashDevelop, and HaxeDevelop exist by the generosity of others and for the help from this community.

Hi, don’t hesitate to post about the issues you have. OpenFL aims to be as friendly as possible for as3 devs so it’s always interesting to hear about issues from newcomers !

You were unlucky with haxe 4.2, I switched to Haxe and OpenFL from as3/Air 2 years ago and the transition was quite smooth for me (much easier than I expected although intimidating at first) but I’m mostly working with Starling.

Also there is a discord server Join the official OpenFL Discord!

2 Likes

I think Heaps is working with Haxe4.2 now saw they just released a version, and likely you can get OpenFL and Lime working if you build yourself. I have not tried, but NME I was told has been updated. Generally with Haxe the toolkits download versions take awhile to catch up when new haxe is released, but often if your willing to work out how to get latest to work, you can build yourself as normally they follow the dev, but give yourself a few hours as it’s not always straight forward. Normally OpenFL will work really well on desktop and browser with a suitable Haxe version, but then again mobile/console sometimes can add complexity, so don’t dive into mobile till you have worthwhile project as it may not always work without some care especially after a recent haxe update, but in theory you should be able to do mobile without modifying desktop version.

With OpenFL once you get a compile your normally good to go, so it’s pretty reliable at runtime it’s just setup of the headers and haxe compiler changes that can mess up the compile, so it may sometimes feel unreliable to setup but once your done it’s normally very good, and most of the problems are down to a new haxe releases not yet fully incorporated.

Again I must apologize for my slow response–under the weather the past several days.

Thank you for the invite to post issues. I will probably post something soon. I figure I should do some more documentation reading, and slogging though it first. I’m not a web developer and have next to zero experience debugging html. My only JavaScript development has been writing a few advanced batch scripts for Photoshop. So when “Node.js” was mentioned, I had to look it up. However, I am now looking at using OpenFl and targeting HTML5 and hopefully WebAssembly (haven’t installed Emscripten yet) to look at possibly developing a web version of a couple of AS3 Air kiosk applications.

For any other beginners that might find this thread, here are a couple things I learned trying to target HTML5 with HaxeDevelop. I have been trying to get Haxelib and OpenFl examples to run. So far, only the Haxelib OpenFl examples, found buried deep in the HaxeToolkit installation folder, are working for me.

  • When I switched my default browser from Brave to Firefox, things started to work (be sure to use the Debug and HTML5 dropdowns in HaxeDevlop).There are probably settings I could change to make Brave work, but for now Firefox is fine by me.

  • Having multiple instances of HaxeDevelop open at one time can cause problems. Multiple instances of FlashDevelop for Air projects has always been pretty solid for me, and I used it a lot to reference code from various projects, however, it just plain didn’t work in this situation–and it wasn’t obvious that that was the problem. Might well be something any web developer would automatically know, but it took a while for this newb to figure it out.

Thanks again for the assistance.

1 Like

Thank you for those pointers.

I must admit, I have been hoping to not have to dive that deep yet. My first step is to see how long it would take to convert a smaller project from AS3 Air captive runtime for Windows to Haxe OpenFl for web.

I’ve had the luxury of using a fairly turn-key environment (FlashDevelop for AS3 captive runtime projectors for Windows) and a single environment target for a quite a while. So what might take a few hours for most (building OpenFl, Haxelib, Lime), could take a good deal longer for me.

I’m also hoping to put off getting more familiar with C++. I’ve barely used it. I have years of experience writing in a K&R version of C, and I loved it, but that was a long time ago.

Once I get more HTML5 examples running, I will probably figure out how to make a Windows desktop application–for the easiest porting experience (I had some issue trying that last time. I don’t remember the exact error message, but it seemed like I might need to install VSCode). I’m hoping that doesn’t require me to build OpenFl.

It looks like the display libraries I used in AS3 are all there in OpenFl. On quick look, the events and callbacks I use for loading images and XML files asynchronously should port over quickly enough too. I’m hoping I can use Haxe’s Xml class close to the same way I used AS3’s XML class.

If I clear those milestones, then I have to look at what is involved in making a OpenFl web project responsive. I’ve had the great luxury of developing for a single known resolution, and letting full screen mode take care of ancillary application uses on non-target machines.

If I recall correctly, a couple years ago when I was considering OpenFl, it didn’t have a direct equivalent of AS3’s ServerSocket, which I use to synchronize multiple computers and displays for exhibit installations. But I don’t need that for the current projects under consideration for the web, and so far I haven’t run into anything else that would obviously require much re-write. Also, I presume Haxe has that capability built in, even if with a different implementation.

Thank you again for the great support from the OpenFl community.

For any other beginners having the following error:

Error: 64bit is not automatically supported for this version of VC. Set HXCPP_MSVC_CUSTOM and manually configure the executable, library and include paths

Here is a version of the post I made in Haxe.org with a solution.

Thank you @Gama11

I can now compile and run the Pirate Pig sample!

For anyone else having the HXCPP_MSVC_CUSTOM error message while to trying to get started, my quick suggestion is to just skip Visual Studio Code (at least for now) and go with Visual Studio Community or some other full IDE version of Visual Studio.

Here is a screenshot of the checkbox mentioned for the install:

Now the longer version explaining why I suggest skipping VS Code, to help you avoid my pitfalls, in case you need convincing.

I had gone with VS Code over VS Community because that is one recommended by OpenFl.org (I was using HaxeDevelop, but eventually realized I would need more than just that for creating .EXE output). I had had VS Community installed on my computer before a Windows update crashed both my boot drive and a clone copy of it and forced me to re-build. But I thought VS Code might be the path of least resistance for getting rolling with Haxe. There was probably good reason why it was suggested by OpenFl.org.

For reference:

OpenFl for Haxelib download:


then here for next step of choosing a code editor:

After reading @Gama11’s comment , I went back and reinstalled VS Code and finally realized that C++ was not installed with it. You have to do two additional steps. You have to enable C++, and you have to find and separately install a C++ compiler. (I took screen shots and would be glad to post if anyone asks–but this didn’t work for me).

VS Code’s C++ enabling window offered a couple links for help installing a C++ compiler.

I checked out this one first, because it had MSVC in parens in the link.


But when scanning through the page (too quickly), it thought it required that an IDE version of Visual Studio, such as Community, already be installed. I didn’t want to possibly mess things up by having two different versions of Visual Studio installed, so I went with this link instead.

That link has steps for using the Minimalist GNU for Windows compiler. I installed and went through the Hello World example, but it didn’t work (duh–it’s not MSVC) when trying to build Pig Pirate under HaxeDevelop.

So I went back to the prior link and read just a tiny bit further down the page and found this:

You can also install just the C++ Build Tools , without a full Visual Studio IDE installation.

Ohhhhhhh.

So I went to the indicated download page to download the tools:


But on that page, after I hit the right drop down and found the download button for Build Tools for Visual Studio 2019 it kept kicking me back higher up the page and the only workable option I found was to download a full version of Visual Studio 2019 (Community for me).

So I did that, and installed it, using the check mark indicated above, rebooted the computer as required, and then my build of Pirate Pig in HaxeDevelop worked without ever even launching Visual Studio Community.

So I suppose I could now go back into VS Code (which I did not uninstall) and connect it with MSVC, but why bother right now? I’m just trying to do the most basic stuff for now and it’s already taken me forever and a day just to get the provided samples running. If I decide to go with Haxe and OpenFl, I can look at that later.

Good luck fellow beginners.

2 Likes

Yeah, Visual Studio and Visual Studio Code are completely different products, even though they share the same root name. To compile Haxe to C++ on Windows, you must have the real Visual Studio installed (the free Community edition is fine), even if you also use Visual Studio Code as your editor for Haxe projects.

@joshtynjala Thank you for confirming.

OpenFl, has some great easy to follow instructions, and great community support, but so many things just haven’t worked. I’ve compounded the problem by not being a web developer and starting with HTML5 targets, but I doubt I am the only one in that situation. Plus I don’t like to hit up the community for help until I’ve pounded my head against the wall for a worthy amount of time.

Hopefully I’m an anomaly, but over the past year or so I’ve looked into Roblox Studio (developed a prototype game–even though I had never seen Lua before, have minimal 3D experience, and my math ability has rusted), Godot, Unity, and even started looking at UE4 again which I had used for a very simple (no code) prototype years ago. Haxe & OpenFl has been the hardest by far to get running. I haven’t even gotten to the language and possibly converting my AS3 Air (FlashDevelop) projects yet. I’ve just been trying to get the provided samples to build and run.

Clearly Haxe/OpenFl are at a disadvantage, because, except for Godot, those are well funded companies, though Godot did receive a $250,000 grant from Unreal, so it has some pretty serious funding. But OpenFl is SO close to having the easiest path to getting going with it’s nicely formatted and worded web pages.

The point? About three years ago there was a thread in the Haxe forums about the future of Haxe/OpenFl and getting the word out to help Haxe/OpenFl survive and grow. Clearly Haxe and OpenFl are still here and they appear to be stronger now. However, I think maintaining working samples for beginners would really help grow the community–and the supply of motivated former AS3 developers looking for what is next has to be dwindling. Most of the samples provided by Haxe/OpenFl either haven’t worked for me so far, or have a been a real bear to get running.

I will now get back to the DisplayingABitmap sample and will look at the tutorial on it. That should be super simple for someone who has done plenty with Bitmap’s and BitmapData in AS3. But after the following easy step by step instructions on the OpenFl download page, the test doesn’t build from the command prompt.

\WAIT! I just tried again and for some reason “openfl test html5” now works from the command line! I had created this sample in multiple different folders, on multiple days, and it never worked before.

I still can’t build it from it’s .hxproj file in HaxeDevelop (Type not found : io.nme.samples.DisplayingABitmap), so I will have to slog it through it a bit more. In HaxeDevelop, for this project, there are no entries in the target dropdown list next to the Debug/Release dropdown, so I will probably start with trying to figure out how to add targets. Or maybe I should just create a new OpenFl project and then copy code? Or maybe I should look at the tutorial? Arghhhhh!

Hmmm… It looks like the .hxproj files included with the OpenFL samples are really out of date. The source code should be good, though. So you might be better off creating a new project with everything except the existing .hxproj file.

Someone will need to go into the openfl-samples repo and update those .hxproj files.

This is all really great feedback, by the way. I hope you’ll keep sharing your experiences as you get further along.

The beginner experience is not quite as streamlined as it should be, and I’ve been advocating for improving the onboarding process since I started using OpenFL myself a couple of years ago. At the time, I started my own getting started troubles thread, and things have definitely improved since then. Hopefully, your feedback will have some impact too.

Thanks @joshtynjala. Like I said, great support from the OpenFl community.

I’ll go the new project route.

@joshtynjala I’ll take up your invitation to keep sharing my experiences.

OpenFl DisplayABitmap sample partially working using HaxeDevelop.

One step at a time fellow beginners. After editing the sample’s source code, I got it working for Windows, but not HTML5.

To get the DisplayABitmap example from OpenFl to build and run using the current version of HaxeDevelop I create a new OpenFl project, overwrite the default Main.hx code with that from the DisplayABitmap example, and put copy of the openfl.png image from the sample in both the new projects “assets” folder and the “assets/img” for good measure.

I started with Debug/windows as the target.

Hit the cog, then after the full build hit the arrow to build and launch the debug version. This gave me the error message:

[lime.utils.Assets] ERROR: There is no IMAGE asset with an ID of "assets/openfl.png

Fortunately for me, upon creating the new project I had read the entire openfl-readme.txt file. It mentioned the project.xml file and the Assets class. The project.xml file contains the element:

assets path=“assets/img” rename=“img”

So I changed the image URL in the source code from “assets/openfl.png” to “img/openfl.png” and then the build. Now the application finds the copy of the image I put in the assets/img folder.

That’s great!

But it doesn’t work when I target Debug/html5 or Release/html5 (to try the release version I open the index.html I find in the bin/html5/bin folder. I just get a black window for either version.

I don’t know why. I rebooted the computer and tried again to no avail. Doesn’t work from the command prompt either.

I wanted to try targeting Hashlink, but that is not available to me in the target types in HaxeDevelop.

The application does work targeting Neko!

I suppose I need to research the Assets class and figure out if and why it applies differently for the HTML5 target. Arghhhh!

Try opening up the web browser developer tools, and check to see if there are any errors in the console. That might give you a clue.

@joshtynjala Thank you for the tip.

After nearly punting on Haxe/OpenFl, not by decision, but because I found myself looking for other things to work on to avoid dealing with it, I closed HaxeDevelop, re-opened the project without re-booting the computer, ran Debug/html5, and it worked!? Release/html5 worked too.

I think I will skip the rest of the examples, read the AS3 Conversion Guide,

then try converting a small application–tiny step by tiny step.

Thank you everyone for the help.