Asking for general knowledge - is there a way to call a function inside a Hype extensions block of code (in the document head) from a timeline or symbol action?
I’m guessing that’s not possible without the use of a “bridge” function in the resource library that would call the method in the extension?
If you define a function in the head area, you could then easily ‘call’ the function just by referencing its name as a one-liner Hype JavaScript function. So in the head you can have:
function myFunction() {
// function
}
Then as a JavaScript function in Hype, you could run: myFunction(); – this can be done as a Timeline Action. And the above function (as long as it runs within the block of code after the Scene Loaded callback) will be available and defined.
This might get a bit more complex depending on what you what you want the function to actually do or if it needs to manipulate something in Hype.
so you’ve got custom function within a ‘hypedocumentload’ or ‘sceneload’ callback. this is great to have full access to hypes API. -> just assign it to the hypeDocument object: