How do I use php in Construct 2?

Get help using Construct 2

Post » Wed Sep 14, 2011 3:53 am

[QUOTE=Tom] Ghengis, I don't have time to read the tutorial fully but at a quick glance it looks superb, good job!

Just so you know, you can split it onto multiple pages with:

==========

It's quite a long page so might be a good idea![/QUOTE]

Thanks for the tip.

I didn't know I could split up the pages. When I was writing it, I did notice an unusual amount of scrolling on my part. I'll split it up. Things will be neater and it will load faster too.

*updated didn't to didGhengis2011-09-14 16:17:14
B
19
S
8
G
7
Posts: 120
Reputation: 5,698

Post » Wed Sep 14, 2011 3:11 pm

Ghengis...you totally rock! Thank you.   
B
22
S
9
G
3
Posts: 203
Reputation: 3,653

Post » Wed Sep 14, 2011 7:27 pm

Thanks for the kind comments everyone.

I've updated the tutorial as per Ashley's suggestion (it was very handy). I also updated the .zip download.
B
19
S
8
G
7
Posts: 120
Reputation: 5,698

Post » Thu Sep 15, 2011 2:28 am

In your tutorial you have the AJAX event as:

AJAX -> on "" completed... action = txtReturnData -> set text to AJAX.LastData


But in your capx file it shows instead:


AJAX -> On AJAX.LastData completed...action = txtReturnData -> set text to AJAX.LastData

B
22
S
9
G
3
Posts: 203
Reputation: 3,653

Post » Thu Sep 15, 2011 2:56 am

[QUOTE=droptank21] In your tutorial you have the AJAX event as:

AJAX -> on "" completed... action = txtReturnData -> set text to AJAX.LastData


But in your capx file it shows instead:


AJAX -> On AJAX.LastData completed...action = txtReturnData -> set text to AJAX.LastData

[/QUOTE]

Thanks for finding that. I've updated the zip file.

It works either way - at least that's what I found. I'm sure the final version of Construct 2 will have some kind of update or official docs on the stuff we're all using.

For now, use the "" version.



B
19
S
8
G
7
Posts: 120
Reputation: 5,698

Post » Thu Sep 15, 2011 6:05 pm

My first attempt didn't do anything.

.http://www.mypwn.com/ajaxexample/

I FTP'd your example as well and it GET's the info in the php file...it just doesn't display in the text object.

.http://www.mypwn.com/ajaxtutorial/

I'll keep tinkering and hopefully figure out what I'm doing wrong.
B
22
S
9
G
3
Posts: 203
Reputation: 3,653

Post » Thu Sep 15, 2011 8:11 pm

Same issue for me. BTW how to debug it?
B
14
S
5
G
5
Posts: 80
Reputation: 3,625

Post » Thu Sep 15, 2011 8:23 pm

droptank21 and Mehtab,

This is good to know. Can you guys PM me your .capx file. I'd like to take a look. As well, make sure sure that the index.html that gets generated by Construct2 is in the same directory as the ajaxexampleGET.php file.

If anyone is having issues please PM me, It would be good to know why it isn't working. I will post whatever I find.
B
19
S
8
G
7
Posts: 120
Reputation: 5,698

Post » Thu Sep 15, 2011 8:30 pm

[QUOTE=droptank21] My first attempt didn't do anything.

.http://www.mypwn.com/ajaxexample/

I FTP'd your example as well and it GET's the info in the php file...it just doesn't display in the text object.

.http://www.mypwn.com/ajaxtutorial/

I'll keep tinkering and hopefully figure out what I'm doing wrong.[/QUOTE]

I just checked your c2runtime.js file. It is showing my domain vs. yours. You should change:

http://www.jtadeo.com/scirra/ajax/ajaxexample1/ajaxexampleGET.php

to

http://www.mypwn.com/ajaxtutorial/ajaxexampleGET.

This is a crossdomain issue.

B
19
S
8
G
7
Posts: 120
Reputation: 5,698

Post » Thu Sep 15, 2011 11:02 pm

capx sent
B
22
S
9
G
3
Posts: 203
Reputation: 3,653

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: blissfulwizard, DevinMurray and 15 guests