Change scene when click a button from iframe


(chans) #1

I have 2 buttons in an iframe with code
window.parent.document.showSceneNamed(‘scene1’); //
but it did not work.
Help me, please
This is my file. testvideo2.zip (1.5 MB)


(Jonathan Deutsch) #2

There’s a few things that are wrong. Note that a hype document is different than the browser’s document variable. You get at Hype documents via the HYPE.documents array. The second issue is in the scene2 code, the closing tick mark is actually an apostrophe/smart quote: ’ vs ’, which isn’t valid code. What you’ll want to use is this code:

window.parent.HYPE.documents['intext'].showSceneNamed('scene1');

and

window.parent.HYPE.documents['intext'].showSceneNamed('scene2');

(chans) #3

It works perfectly.
Thank you so much jonathan.
You saved my life.