Change scene within an IFRAME


(Stefano Murgia) #1

How can I load a different scene from the first one inside an IFRAME?
To better understand the problem:

At the page https://www.ercartomatto.com/Er%20Cartomatto%20-%20Cartoleria%20-%20Yub%20diario.html to the menu “IN WHAT CAN WE USE?”, I would like the second scene of the file to come out.

Thanks in advance for the help you can give me


(Jonathan Deutsch) #2

I couldn’t find the menu in question so I’m not sure about the setup.

The solution requires javascript and the Hype Javascript API to change scenes.

If you are looking to have a child iframe change the scene of a parent, you can simply call:

window.parent.HYPE.documents['documentName'].showSceneNamed('sceneName');

If you are looking to have a parent iframe change a child, this requires using the postMessage call and signaling such that a handler is called on the iframe that can use the Hype API. I think there are some examples of this via searching the forums (though perhaps not exactly doing a scene change).

I believe the global behavior extension project can also help: Hype GlobalBehavior (Custom Behavior Extension)


(Stefano Murgia) #3

Thank you.
Resolved.
I have followed the recommended page: Linking to a specific scene from inside and outside of a Tumult Hype document