bassgi
February 14, 2023, 9:55am
1
Hello
I exported 2 HTML5 folders from 2 Hype projects. Is it possible to program a new project in which the first scene has 2 buttons to select the 2 exported HTML5 files? Does this work with HTML widgets? And how?
Many thanks for your help!
MaxZieb
(Loves Hype)
February 14, 2023, 10:31am
2
Maybe this helps... (Forum URL doesn't work in the example anymore as they don't allow loading it in an iFrame anymore, but code is fine):
Here is the file you tried with:
LoadFrameBasedOnVarSameScene.hype 2.zip (25,6 KB)
The code used for an button is:
var sceneElm = document.getElementById(hypeDocument.currentSceneId());
var iFrameElm = sceneElm.querySelector('.myFrame');
iFrameElm.setAttribute('src', element.dataset.frameSrc);
given you have an iFrame with the classname myFrame
But there is another file that should also help understand how it works but it’s a bit older:
This might also be interesting for communication across iFrames
[HypeGlobalBehavior]
This idea got triggered back in the day when trying to explain Custom Behavior as Tweets . The idea stuck with me …
Mostly I use Hype these days for Widgets in CMS-Projects, hence I thought I share the concept of a unified communication pipeline across individual widget. So, I recreated LocalConnection from the Flash-days with a little Twitter-twist and named it GlobalBehavior:
Hint: The code is an extension. It enables all Hype-Widget loaded on the sa…
bassgi
February 14, 2023, 12:37pm
3
Hello Max
Thx for your quick answer. Where can I put my html5 files for the knobs?
Best regards
Pascal
MaxZieb
(Loves Hype)
February 14, 2023, 1:26pm
4
I am not sure what you mean with knobs. Please provide a sample file (doesn't need to be the full project) as a ZIP for applied help.