How can i communicate (send, receive data) via javascript?

For developers using the Construct 2 Javascript SDK

Post » Tue Mar 01, 2016 9:50 am

Here's the jist. We're creating a webpage, with a little bit of HTML & CSS. We've made a back-end with API and the javascript from the page should load the data (via the API). Now we modify and can work with the data.
Now I want my data i just brought in to be able to be used by construct2 and vica versa. All of this will be inside an IFrame.

For example:

The game starts, construct 2 game runs in the background while the first html & css modal appears on top of the construct 2. This is going to be a small questionnaire modal (age, where you're from, gender, ...) and all will be handled outside of the game/construct. But then when the user completes his "registration" and clicks a button in html5 ('Go to Game' or something), i have to trigger something in construct 2 so that he goes from layout 1 to layout 2. I already know how to do this INSIDE construct 2, which is easy, but now i want it to work so that when a user presses a button in html5, a construct 2 function/event is called.

Does anyone know how to do this exactly?
Posts: 50
Reputation: 517

Post » Tue Mar 01, 2016 11:04 am

Scirra Founder
Posts: 25,198
Reputation: 200,327

Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests