How do I add an argument to functions?

Another note … if you are defining the onmouse by yourself outside of Hype IDE, you would need to fetch the Hype API first. Beware that the export name (your choice) differs from the preview name (always index). This becomes relevant when fetching the Hype API as follows:

var hypeDocument = HYPE.documents['index'];

There is a workaround that is name agnostic but it always uses the first found Hype document. That might also not be ideal on a page with more than one Hype document and you not being in control of loading order … but in cases of a single Hype document it works.

var hypeDocument = Object.values(HYPE.documents)[0];

These examples assume you need the hypeDocument outside of the Hype IDE, Head HTML or inside a rectangle on stage (DIV).

Please also consider reading up on Hype Events and getHypeDocument(…) for further ways to get the current hypeDocument when needed outside bespoken scopes.

2 Likes