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.

Call Puzzle procedure from external JS ?

Home Forums Programming Call Puzzle procedure from external JS ?

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #39073
    psykokwak
    Participant

    Hi all,
    I embbed my V3D app into an iframe and I would like to call a custom procedure puzzle from the parent javascript.

    For exemple doing something like that :

    
    var iframe = document.getElementById("verge3diframe").contentWindow;
    iframe.v3d.apps[0].CameraMoveToGlobal();
    

    Thanks.

    Attachments:
    You must be logged in to view attached files.
    #39077

    Hi,

    you can trigger procedure puzzles from JavaScript as shown here
    https://www.soft8soft.com/docs/manual/en/introduction/Using-JavaScript.html

    Chief 3D Verger | LinkedIn | Twitter

    #39079
    psykokwak
    Participant

    Thanks for your answer.
    But how access to the “PROC” from parent frame javascript ?

    #39138
    psykokwak
    Participant

    OK. I copied all the usefull code from visual_logic.js to my own js library. It works but it make a lot of code redundancy.

    #39139

    Hi, You can surely execute the procedure from the external iframe. See here for more info.

    Soft8Soft Tech Chief
    X | FB | LinkedIn

    #39141
    psykokwak
    Participant

    Hello Alexander,
    Thanks for your help.
    But I’m sorry but it does not work.

    I can access to the iframe v3d context from my parent document using :
    var iframe = document.getElementById("verge3diframe").contentWindow;

    But I don’t know how to access to my visual_logic (= my puzzles) from there.

    Your documentation says we can use PROC to access to puzzles procedures but it works only on “exec script” puzzle.

    #39151
    Crunch
    Customer

    try

    document.getElementById(“verge3diframe”).contentWindow.v3d.puzzles.procedures.abc();

    where “abc” is the name of your procedure in puzzles.

    #39152
    Crunch
    Customer

    line 50

    Attachments:
    You must be logged in to view attached files.
    #39165
    psykokwak
    Participant

    Ahhh :yahoo:
    Thanks a lot. It’s exactly what I looking for.

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