I'm use the example file "Loading script & WASM" from construct 3. In the scriptfile "external.js" i'm add a new function:
function testing() { return "ok it works!"; }
How can i call in a expression the function testing in script external.js and get the callback "ok it works!" ?
Create an event sheet function with a string return value. Inside the event sheet function, add a script action with:
runtime.setReturnValue(testing());
Now you can call the event sheet function as an expression, and it returns a value from JS.
The general approach is to "wrap" JS functions with event functions.
Develop games in your browser. Powerful, performant & highly capable.
It works now, thank you.