Making a link open up in CocoonJS

Get help using Construct 2

Post » Sun Dec 02, 2012 11:49 am

Hello everyone,

Just got our game going to Apple for approval for iOS!!! We want to make a free version too that when you get to a certain level it gives you the option to buy the game. So I need to know, is there any way of opening an external link to the App Store from within CocoonJS to the full game???

I just read that they do support that in the latest build of CocoonJS so I guess the question is, how do I set up Construct 2 to allow me to do this?

Thank you all
B
20
S
3
G
4
Posts: 77
Reputation: 3,346

Post » Sun Dec 02, 2012 2:45 pm

I don't know how to from Cocoon only, but the latest Clay.io plugin has it as a simple event (working through Cocoon). You can check it out here: http://clay.io/members/community#/categories/construct-2-pluginTobye2012-12-02 14:46:29
B
27
S
8
G
5
Posts: 429
Reputation: 6,902

Post » Sun Dec 02, 2012 2:51 pm

The Browser object's 'Open URL' action uses CocoonJS's open URL function when in CocoonJS.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Mon Dec 03, 2012 8:19 pm

Nice one, I will try that out asap!
B
20
S
3
G
4
Posts: 77
Reputation: 3,346

Post » Tue Dec 18, 2012 12:22 pm

[QUOTE=Ashley] The Browser object's 'Open URL' action uses CocoonJS's open URL function when in CocoonJS.[/QUOTE]

Neither the Browser object's:

Go To URL
or
Open URL in New Window

seem to work. They just go to black screen

I have tried using the CocoonJS launcher, and also cloud compilation on 3 iOS decices ( iphone 3, 5 and iPad )

Has anyone else actually got this working?

Thanks

Danny
B
4
Posts: 11
Reputation: 447

Post » Mon Feb 04, 2013 6:21 pm

Same problem here. Tried using both open url and open url in a new window, but no success. Has anyone tried alternative methods?
B
2
Posts: 1
Reputation: 252

Post » Fri Feb 22, 2013 2:21 pm

I don't actually use Construct but this also took me quite a while to get so I thought I'd share. Here's how to open up links inside CocoonJS:

Include CocooJS.js and CocoonJS_App.js in your html file

[code]<script src="js/extensions/CocoonJS.js"></script>
<script src="js/extensions/CocoonJS_App.js"></script>
[/code]

Then use [code]CocoonJS.App.openURL(yourUrlHere);[/code]

You might need to change the <script> tag to point where your CocoonJS.js and CocoonJS_App.js files are.

Cheers!
B
1
Posts: 1
Reputation: 227

Post » Wed Oct 02, 2013 6:20 am

@jaunesarmiento
Thank you so much, It's working
B
64
S
16
G
20
Posts: 471
Reputation: 16,131

Post » Sat Oct 19, 2013 9:16 pm

@ jaunesarmiento

Where do I find these 2 js files
and how do I use the > CocoonJS.App.openURL(yourUrlHere);
on touch a sprite

REGARDS
Flemming
B
23
S
12
G
10
Posts: 323
Reputation: 7,382


Return to How do I....?

Who is online

Users browsing this forum: Colorfish and 28 guests