We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

dssctr

Forum Replies Created

Viewing 7 posts - 46 through 52 (of 52 total)
  • Author
    Posts
  • in reply to: Slider UI and Shapekeys #12064
    dssctr
    Customer

    Wow sounds great. Might there be any examples in the future?

    in reply to: Back from BCon18 #8424
    dssctr
    Customer

    :yahoo:

    in reply to: How do you call functions from the root html file? #7553
    dssctr
    Customer

    :yahoo: Thankyou! I’ve got it working and talking to LMS software….

    in reply to: How do you call functions from the root html file? #7545
    dssctr
    Customer

    So 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.

    in reply to: How do you call functions from the root html file? #7479
    dssctr
    Customer

    Thanks 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?

    in reply to: How do you call functions from the root html file? #7417
    dssctr
    Customer

    Hi Yuri,
    Thanks, I am now able to call a function from my index.html to my_function.js

    however..

    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?

    in reply to: How do you call functions from the root html file? #7335
    dssctr
    Customer

    Hi 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

Viewing 7 posts - 46 through 52 (of 52 total)