How do I get Actuate to work in Electron? (re-entered post)

Hi,

I have a Haxe project that targets HTML5 and successfully uses an Actuate tween. It works when targeting Windows too. When I build an Electron application, everything works except the tween.

Unfortunately, what’s going on under the hood is not my forte–nor is web development.

To create the Electron app I have been using the steps from @joshtynjala’s FeathersUI documemtation:

I’ve tried to modify the Electron build process as suggested by @singmajesty

Though I have no idea what “yo openfl” is supposed to be.

Here are my steps:

Use VSCode to build HTML5 debug version and verify tween works
In DOS prompt, go to project folder and enter

openfl build electron -debug

I make a copy of bin\electron\haxe\debug.hxml and put it in bin\electron\bin renamed as debugbbw.hxml
I edit debugbbw.hxml to add

     -lib actuate

cd bin/electron/bin

I edit the project.json file in that folder by adding:

            "postinstall": "haxelib --always install debugbbw.hxml"

I run

npm install

I get the message “You already have actuate version 1.8.9 installed”, but no errors.

I run

npm start

or

npm start -s

The tween does not work. No error messages in debug console.

Haxe compiler 4.2.4
haxelib 4.0.2
openfl 9.0.2 [9.1.0]
lime 7.8.0 [7.9.0]
Actuate 1.8.9

Also, I have edited FilterActuator.hx in the Actuate library to use Std.isOfType() rather than Std.is() to avoid warnings about deprecation.

Anyone know where I’m getting it wrong?

Thanks.

Something’s going on within the SimpleActuator.hx constructor, startTime is 0 instead of a real value on Electron target, haxe ifs get messed up, I’m sure someone will take a look at it later (maybe you can create a github issue)

For a quick solution build your app with

openfl build electron -debug -Delectron

or even better add

<haxedef name="electron" />

to your project.xml, it’ll be fine after that. Just tested it, this seemingly fixed it.

Cheers

Edit: I didn’t do any special magic, just created a simple feathers app, built the project for electron target, ran npm install and npm start.

2 Likes

@igazine Thank you so much! I will try as soon as my computer is done doing some long batch stuff.

@igazine They both work!! Thank you so much!

I spent forever trying to figure it out–at least I learned a little more about the build process.

I had tried building to electron from VSCode before too, but quickly gave up on that since the steps I had outlined were working.

I will have a much better demo for my customer tomorrow morning.

Cheers!

1 Like

Okay, I checked Lime source on Github, and looks like -D electron has already been added to the Electron hxml templates. So if you install Lime from github, it’ll be fine without the previously mentioned haxedef or -D build parameter. Or you can wait til the next Lime release or add it to your own hxml templates (debug, final, release) manually

2 Likes