I have a webpage running 2 processing sketches, i want to call Processing.instances[0].exit() as suggested in this question: Dynamically "unload" a Processing JS sketch from canvas
But when i call Processing.instances it returns null, and i get no errors on the javascript console - also Processing.instances.length returns (0).
Here the javascript code:
document.onkeydown = function(e) { // or document.onkeypress
e = e || window.event;
if (e.keyCode == 115 || e.keyCode == 83) { //press "s" or "S"
alert(Processing.instances.length);
}
};
And here the url for the website: http://culturadigital.cc/nuevaweb
Thanks