Call javascript out of Hype


(chans) #1

I use this code to call javascript out of Hype but it does not work
window.HYPE.documents[‘intext2’].getElementById(‘videoid’).play();
untitled folder.zip (2.7 MB)

Help me please


(Jonathan Deutsch) #2

Parents cannot communicate to child iframes unless using the javascript postMessage call. There are examples on the forums in using this; it requires a bit of code.

Depending on what you are doing, it may be easier to not use an iframe/HTML Widget. Instead, if you have two hype animations in the same .html document (by copying the <div> code), then you can play video in this manner.