runOnStartup(async runtime =>
{
// Code to run on the loading screen
runtime.addEventListener("beforeprojectstart", () => OnBeforeProjectStart(runtime));
});
function OnBeforeProjectStart(runtime)
{
// Code to run just before 'On start of layout'
// on the first layout. Initial instances are created
// and available to use here.
runtime.layout.addEventListener("beforelayoutstart",
() => OnBeforeLayoutStart(runtime));
runtime.addEventListener("tick", () => Tick(runtime));
}
function OnBeforeLayoutStart(runtime)
{
// Attach the script from the files folder..
var filesScript = document.createElement('script');
filesScript .setAttribute('src','testscript.js'); // Don't work
document.head.appendChild(filesScript );
console.log("-------------------------------");
}
function Tick(runtime)
{
// Code to run every tick
}
I got the error "Failed to load resource: the server responded with a status of 404 (Not Found)".