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.

Unable to Reference Updated Global Object From External Interface

Home Forums Programming Unable to Reference Updated Global Object From External Interface

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #24208
    jstubbjstubb
    Licensee

    Hello,

    It seems my last post was deleted for some reason. Errors kept appearing when I attempted to upload screenshots to the post.

    I am currently attempting to update a global object from outside the verge3d application js file and subsequently reference it inside the application js file in order to call puzzles based on those values.

    The issue I’m currently having is that despite the object appearing to have updated values (when logged with the console after changing settings), when puzzles tries to reference the object it still only has the initial values of the global object from when the application was loaded.

    Here is a small snippet of the code I am using to reference the object from puzzles and update it respectively:

    and for updating the object:

    The attached screenshot shows the discrepancy in the console log.

    Attachments:
    You must be logged in to view attached files.
    #24259
    Yuri KovelenovYuri Kovelenov
    Developer

    Hi,

    if try to set your variable to a number or String rather than Object, will it work as intended?

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

    #24304
    jstubbjstubb
    Licensee

    Hello Yuri,

    Thank you for your response.

    The same issue still arises even when the variable is a string or a number.

    #24327
    Yuri KovelenovYuri Kovelenov
    Developer

    can you prepare an example project for us that we could debug?

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

    #24366
    jstubbjstubb
    Licensee

    Yes I have one ready. Would you like me to upload it to the Verge3D Network or send it by some other means?

    #24392
    Yuri KovelenovYuri Kovelenov
    Developer

    you can use the newly introduced ‘upload project zip’ feature and share the link with us. Thanks!

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

    #24431
    jstubbjstubb
    Licensee

    Awesome!

    Here is the link to the uploaded file: model_testbed

    Below is a brief description of the code to improve context/understanding:

    * The Verge3D rendering is displayed in an iframe with a button below it

    * The on screen html button changes and console logs the value of the global object (called “nexus”)

    * Clicking any of the model objects will also trigger a reference to the global object from the “external interface” and console log it
    * The discrepancy can be seen by comparing the console log entries

    • This reply was modified 3 months ago by jstubbjstubb.
    #24468
    Yuri KovelenovYuri Kovelenov
    Developer

    Hi,

    It look like some .js were linked from both HTML documents, which resulted in conflicts.

    Here is the modified index.html which seemingly works as intended.

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

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

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.