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.

External Call fails for me

Home Forums Bug Reports and Feature Requests External Call fails for me

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #455
    Avatarlukevideo
    Participant

    i get a error message when i try to use the external call app. It fails in firefox and chromium.

    #456
    Avatarlukevideo
    Participant

    Maybe it’s just a demo of the call but if it console.log something it might be nicer… :wacko:

    #457

    Hi Luke,

    You should define your external function first, for example:

    v3dApp.ExternalInterface.myJSFunction = function(a, b, c) {console.log(a, b, c)};

    Just paste this in console for quick test.
    P.S. Will make explanations for that example app.

    3D Verger, the CEO
    LinkedIn | FB | Twitter | VK | 新浪微博

    #707
    Will WelkerWill Welker
    Customer

    Still getting an uncaught error in the ‘External Call” example.
    Uncaught
    It seems like if I was adding my own functions to call, it should be in External_Call.js, but there is no such file.

    • This reply was modified 3 years, 4 months ago by Will WelkerWill Welker.
    Attachments:
    You must be logged in to view attached files.
    #710
    Will WelkerWill Welker
    Customer

    I should add, it happens when clicking the plane.

    #711

    Hi Will,

    This example seems to be over-minimalistic :) You can quickly make it work by pasting to the browser console something like

    v3dApp.ExternalInterface.myJSFunction = function(a, b, c) {console.log(a, b, c)};

    After that this function becomes ‘registered’ in the ExternalInterface namespace and available to Puzzles.

    But of course, application developers should implement external functions in their code, so that they become persistent. To do this, create a ‘Custom’ application with App Manager and add that line of code in the main JS file (where the comment ‘add you code here’ is found). This way your app’s JS code will communicate with Puzzles and vice versa. :)

    3D Verger, the CEO
    LinkedIn | FB | Twitter | VK | 新浪微博

    #716
    Will WelkerWill Welker
    Customer

    Ok, I got it figured out. I think what is confusing about this, is that for an example, the expectation is that it is all complete and working.
    Here is an idea to dumb it down a little:
    Add three buttons, one for each box, label each on “Call external function.”
    When clicked these will call MyJSFunction() from an existing JS file and do a console log: “Called MyJSFunction from External_Call.js.
    In this external function, place a call back to the Puzzles “When called from JS” block.
    Maybe with a comment in the JS file: //This function calls the Puzzles block OpenCover.
    Then, console.log(“Call from MyJSFunction to open the” + which_box + “box”);

    Or something like that :unsure: LOL
    Anyway, it would go full circle from Puzzles to custom JS and back to Puzzles with full comments and console logs to explain what is happening.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.