Hundreds of features to explore
Games made in Construct
Your questions answered
Trusted by schools and universities worldwide
Free education resources to use in the classroom
Students do not need accounts with us
What we believe
We are in this together
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
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!" ?
Develop games in your browser. Powerful, performant & highly capable.
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.
It works now, thank you.