Global variables

Get help using Construct 2

Post » Sun Mar 03, 2013 7:40 pm

Hi,
I'm backing sadjeff here : thanks to joe7's example it's possible to pass data with a button click. But would it be possible to do so when the application loads for instance?
B
8
S
4
G
5
Posts: 32
Reputation: 2,816

Post » Sun Mar 03, 2013 9:59 pm

On start of layout perhaps? Look at either the events in the browser object, or system events like on start of layout.
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,428

Post » Tue Sep 16, 2014 8:17 pm

I wanted to pass a variable into C2 via the URL to load the page (like youtube.com/?v=###.) I used the method explained here to call doIt(); in my loading screen and extended it using a tiny amount of php. Thankfully, C2 did not complain when I changed index.html and game.html into php files.

This (should be) a working example:

http://arrall.com/c/?i=13

In the example, the code checks to see if a variable was passed. If so, it skips the login screen, silently logs in as the guest/guest user, and then loads the correct node.

I realize this post is old, but if I had found this post while reading the FAQ post it would have saved me some time.
You do not have the required permissions to view the files attached to this post.
B
6
S
1
Posts: 37
Reputation: 374

Post » Fri Nov 14, 2014 6:18 pm

@arrall soooo.. technically i should be able to solve this issue with your solution... let's give it a go I'll let you know.
Freefall Bird
B
37
S
8
G
5
Posts: 262
Reputation: 5,360

Post » Sun Nov 16, 2014 4:24 am

Example:
http://arrall.com/c2/passvarv2/

Here is an example with no 3rd party plugins. (I hope) You pick a scale and an opacity offset and it sends it to the second app. I assume you could make the textboxes in the second app invisible/offscreen. It is a combo of php, javascript, and construct 2. But very little code to pull it off.

I'm still not sure how to load a graphic from a base64 in Construct 2. But sending the string between apps should not be a problem.

You don't always need 2 apps either. In the brainstorming app I was showing, it would be possible to have it navigate back to the same app with a different node-id passed based on whatever was pressed in the app.

Also posted this to @Ragevortex 's issue.
You do not have the required permissions to view the files attached to this post.
B
6
S
1
Posts: 37
Reputation: 374

Previous

Return to How do I....?

Who is online

Users browsing this forum: Zebbi and 25 guests