Choose src of iframe in separate scene

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:

1 Like