Browser Object

Discussion and feedback on Construct 2

Post » Wed Jul 20, 2016 7:38 pm

Been using the browser object to detect "Is online" and have inverted it with the "X" so I have "Browser X is online" and it does not work anymore.

Was wondering if anything had changed with the browser object ?
B
9
S
3
Posts: 146
Reputation: 1,150

Post » Wed Jul 20, 2016 7:48 pm

Try 'else' ?

Is online
Empty sub
Else
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Wed Jul 20, 2016 9:07 pm

Heh, Thanks it works perfect.
B
9
S
3
Posts: 146
Reputation: 1,150

Post » Wed Jul 20, 2016 10:42 pm

99Instances2Go wrote:Is online
Empty sub
Else


Why empty sub though?
B
32
S
14
G
6
Posts: 163
Reputation: 5,835

Post » Wed Jul 20, 2016 11:12 pm

Need a condition to pair with the 'else'. An empty is just the same as an 'every tick". So it is a condition. But one that runs nothing (no evalution, no actions), in this case just a kinda placeholder to be able to place the 'else'.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Wed Jul 20, 2016 11:48 pm

Hmm scrub that.
Actually, it only works when testing in Chrome or IE
When I export to apk it thinks it's offline both when I try it your way and when I try it mine.
I assume something is not working in the browser wrapper.

I've tried adding website address to the allow intent, just in case.

Looks like it's back to my old way of testing e.g. grab a text file from my server, grab the value within and assign it to a global variable, check the global variable is not zero otherwise you are offline message.
B
9
S
3
Posts: 146
Reputation: 1,150

Post » Fri Jul 22, 2016 7:36 am

frozenpeas wrote:When I export to apk it thinks it's offline both when I try it your way and when I try it mine.

Since then your game is in an offline package, I think this works just as intended.
B
138
S
33
G
17
Posts: 1,560
Reputation: 20,832

Post » Fri Jul 22, 2016 12:35 pm

My game needs to be online as it pulls data files and images from a website.
If there is no data connection I need to let the user know as the game will not work without it.

For me, the browser object does not work for testing "is online" when exported to apk so I have to revert to other means as described in my previous post.
B
9
S
3
Posts: 146
Reputation: 1,150

Post » Fri Jul 22, 2016 3:09 pm

frozenpeas wrote:...For me, the browser object does not work for testing "is online" when exported to apk so I have to revert to other means as described in my previous post.

Sorry, I think I misunderstood you. Since it should work imo, maybe it worth to file a bug report about this.
B
138
S
33
G
17
Posts: 1,560
Reputation: 20,832

Post » Fri Jul 22, 2016 3:54 pm

Some days I'm not very good at explaining lol
Thanks
B
9
S
3
Posts: 146
Reputation: 1,150


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 12 guests