Morning Hypers!
I looking for a little help with a HTML widget iframe button.
Here’s the set up. (everything lives in the same folder, same server)
Hype Scene 1:
HTML Widget with Specified URL (/pano/index.html) showing a pan0 (made with Marzipano)
Hype Scene 2:
Regular Hype scene
I’m looking to add a button/link in the pano in scene 1 that when fired just transitions to scene 2.
As the pano is using a 3D canvas I can’t just add a hype button.
test.zip (121.2 KB) Whats up Max!
Thanks for this suggestion.
I tried to implement this using both manual iframe and also specified url but I cant get it to fire.
I’ve included a demo file incase anyone is able to help.
Thanks!!! 3|690x372
To clarify…the message example you gave works…but if I try to change to the next scene with:
hypeDocument.showNextScene(hypeDocument.kSceneTransitionCrossfade, 1.1)
it fails.
The other way of addressing it should also work. Hardcoding the document name only works if the document name doesn’t change. Which it unfortunately sometimes does.
This approach takes the first found document in the parent so it works despite the name but has the shortcoming that it might fail or be error prune if there are more than one Hype documents on the parent page.
var hypeDocument = Object.values(window.parent.HYPE.documents)[0];
hypeDocument.showSceneNamed('Area2-1',
hypeDocument.kSceneTransitionCrossfade, 1.1);
Or if you use the document name make sure to cover the case with index. Hype exports in preview mode as index but in exports as the desired name.
var hypeDocument = window.parent.HYPE.documents['YOUR-EXPORT-NAME-HERE'] || window.parent.HYPE.documents['index'];
hypeDocument.showSceneNamed('Area2-1',
hypeDocument.kSceneTransitionCrossfade, 1.1);