Hello,
New here so sorry if my understand of C2 is limited.
I have an external Javascript files located in the same directory as the exported index.html which I am using to store all the external functions required for the game. I am using CallJS plugin to interface with this external script which works well in other area of the game.
My problem here is I would like to be able to execute a function in the external script (I assume using CallJS is best here) as soon as the game is loaded. As an example here is my function
someScript.js
var myObject = function() {
function gameLoaded() { //this does not work
//do something here as soon as game loaded
console.log("game was loaded successfully");
}
}();[/code:lvtza9g3]
I have attached this to the system.OnStartLayout event but when the game has loaded this function is not firing (I am using the console log to test this).
How can I get this to run on first load?