• Hey! Guest! The 37th GMC Jam will take place between May 28th, 12:00 UTC and June 1st, 12:00 UTC. Why not join in! Click here to find out more!

GML [SOLVED] Is it possible to execute javascript dynamically through GML?

Xalezar

Member
For example, say when the player clicks on a button in my HTML5 game, is it possible to execute a javascript function at that point in time?
 

FrostyCat

Member
You can implement that as an extension. Create an extension, add a JS file to it, then put this inside the file:
Code:
function myfunc() {
  /* Your code here */
}
Then double-click on the file in the IDE (not in explorer), add a function to it by the same name, and specify the argument count accordingly. Then you can call the JS code from GML using the same name.
 
Top