Get Variable from PARENT Webpage (C2 or C3, Game Embedded in iFrame)

You're viewing a single comment in a conversation. View all the comments
  • 1 Comments

  • Order by
  • Yes!! I tested your tutorial, and it works better than I expected: I can set the parent page var with something like Browser.ExecJS("parent.my_var = 5;") or ("parent.my_var = parent.my_var + 1;")

    I realized that this parent variable can then be passed to another parent page's variable via localstorage and then read from that variable by a separate Construct project embedded in an iframe there. I also learned that the "parent" can refer to the index.html that the Construct project is embedded in (if that page is not embedded in an iframe) or to the parent page containing the iframe containing the Construct project. In that case, "parent.my_var" ignores the index.html and refers to the main page containing the iframe. I haven't fully tested that whole process yet, but it seems doable. Thanks for the tutorial!