A couple things to note:
This is because the function would be made within the scope of that function, and not globally visible.
If you want to make it as a global, you can instead define it as:
window.goScene = function (val2){
Functions made in the Hype editor are not assigned to the global scope. Therefore if you call it like in your code:
<a href="#" onclick="goScene('Notes')">Notes</a><br>
It will not find it, since you are trying to call a global.
Instead, it is assigned in the .functions()
array of a hypeDocument object.
The getHypeDocument()
call is really something that was supposed to help out for calling it in these situations by either using it at that time or assigning as a global hypeDocument object so you could call it like hypeDocument.functions().goScene(...)
.
However, it appears you have removed getHypeDocument()
from the head. It does seem like from a console error you have an element with inner HTML that's trying to use it though.
As another point on this, you are passing a string into the goScene() function, but this is not really good programming practice since hype functions should be taking (hypeDocument, element, event)
arguments.
Note that On Scene Load action will run the function at that time. So this is probably also inappropriate. It is created when your document loads.
showElement
does appear to be a setup function, so this would be okay to use at this time. (That said, I think showElement
may not be the best name, since it implies it will show an element when invoked).