How can I use JQuery to access Construct 2 objects

Get help using Construct 2

Post » Sat Dec 07, 2013 3:24 am

Hi all,

I was wondering if it were possible to use JQuery on my website to respond to a click event going on inside my Construct 2 application. For example, I'm creating a website for a music festival - and I want all of the band names to fall out of the sky on the main page

This Guy

I was thinking about fooling around with .gifs, flash, etc, but for now I'm trying out Construct 2. My question is - is it possible to create an alert window with JQuery/JS if someone clicks on a Construct 2 object? I know I can hardcode all of the information into the application, and will eventually use AJAX to communicate with the database if I need to. lolz
B
9
S
2
G
2
Posts: 47
Reputation: 1,822

Post » Sat Dec 07, 2013 12:20 pm

You probably don't need jQuery, just a little bit of javascript code to call your own function. The best way is to use the Javascript SDK to make your own plugin that talks to the page. If you're happy for hackery though, you can use the Browser object's 'Execute javascript' action - but be very careful with it, since a mistake can break the whole game or the whole page.
Scirra Founder
B
395
S
233
G
88
Posts: 24,376
Reputation: 193,842

Post » Sat Dec 07, 2013 6:11 pm

Thanks, I'll try the Browser Object first, but will probably look around for plugins or make my own later
B
9
S
2
G
2
Posts: 47
Reputation: 1,822


Return to How do I....?

Who is online

Users browsing this forum: Cub3D, David181, Google [Bot] and 20 guests