Go to scene from within html widget

HI!
there is a way to trigger an hype function within a html widget?

To be more specific, in my case I have in the last scene of my document, an html widget with a email form. after submit the form a thank you message appear and then I would like to restart my html. How can I do it?

thank you in advance

m

An HTML Widget is technically an iframe, which means that you have to do a little more work with the JavaScript API to call into the parent. Generally to change scenes from this context, the code would look like:

Object.values(window.parent.HYPE.documents)[0].showSceneNamed('Untitled Scene 2');

In this case it is finding the first hype document in the parent window, and then changing to a scene called "Untitled Scene 2" (which you'd need to change).

thank you so much! works like a charm!!!

1 Like