Forum Replies Created
-
AuthorPosts
-
dssctrCustomer
Wow sounds great. Might there be any examples in the future?
dssctrCustomerdssctrCustomerThankyou! I’ve got it working and talking to LMS software….
dssctrCustomerSo I am getting this in the console, and I’m pressing the button to make the call after the verge player loads.
<em>Uncaught ReferenceError: app is not defined at window.myfunction (my_function.js:184) at playH ((index):34) at HTMLButtonElement.onclick ((index):49)</em>
You can see it here http://www.richardleehill.com/call
I zipped the code below too. Thanks.
dssctrCustomerThanks that’s how I thought it should work, but when I tested it I only got the alert message.
However, when I place the function before the alert like this I don’t get the alert message either, which makes me think that it’s perhaps throwing an error.
window.myfunction = function() { app.ExternalInterface.myJSCallback(); window.alert("myFunction called from index.html playH() now works !" ); }
What’s interesting is that “app.ExternalInterface.myJSCallback()” works in runCode(app) fine.
Thanks again Yuri for all the help. Any thoughts?dssctrCustomerHi Yuri,
Thanks, I am now able to call a function from my index.html to my_function.jshowever..
function runCode(app) { app.ExternalInterface.myJSCallback(); } window.myfunction = function() { window.alert("myFunction called from index.html playH() now works !" ); // how do I call myJSCallback() from here? }
I have 2 questions:
1. How do I call myJSCallback() from window.myfunction
2. the runCode() seems to initially play the puzzle upon loading from line 83, is there way to prevent this?dssctrCustomerHi Yuri,
Thanks for your reply.So what I’d like to trigger is this function from my visual_logic.js:
function do_something() { changeVis("Cube", false); registerTimeout(5, function() { changeVis("Cube", true); }); }
Can I place something like this in my visual_logic.js?
window.myfunction = function() { do_something(); }
…or am I way off?
I am able to call a myfunction() successfully if it’s on the html this way.
var iframeElements = document.getElementsByTagName("iframe"); iframeElements[0].contentWindow.myfunction();
Sorry, I’m an instructional designer, with limited JS but Love what you guys have done and see so much educational potential in it. It really IS amazing. -Rick
-
AuthorPosts