AJAX url literal vs variable

Get help using Construct 2

Post » Wed Mar 14, 2012 9:23 am

Hello -

Sorry if this has already been asked, but I have looked and searched repeatedly and I cannot find a direct answer to this question.

I was attempting to use a sprite's x and y value in the "URL" parameter for an AJAX object. Let us say that I wish to log a sprites location every 60 seconds. Its position on the next interval is 20 x and 50 y. I have found that if I literally code the values into the URL for the AJAX it works fine. For example, this does the job nicely:

"HTTP://mywebsite.com/myPHPfile.php?x=20&y=50"

BUT... when I attempt to do the following nothing happens on my server...
"HTTP://mywebsite.com/myPHPfile.php?x=Sprite.X&y=Sprite.Y"

I am kind of new to this... any help would be appreciated.

Thank you!
B
10
S
3
G
3
Posts: 29
Reputation: 2,769

Post » Wed Mar 14, 2012 9:28 am

how about:
"HTTP://mywebsite.com/myPHPfile.php?x="&Sprite.X&"&y="&Sprite.Y

should solve your problem :)
B
42
S
9
G
6
Posts: 437
Reputation: 5,626

Post » Wed Mar 14, 2012 9:37 am

Thank you... I think I need some sleep. I've been up far toooo long.
B
10
S
3
G
3
Posts: 29
Reputation: 2,769


Return to How do I....?

Who is online

Users browsing this forum: DiabloOvermind, emoticon, odiusfly and 18 guests