External scripts

Get help using Construct 2

Post » Thu Jun 29, 2017 1:13 pm

What's the best method for getting the return value from a .js script placed on the index.html?
Image ImageImage
B
172
S
50
G
183
Posts: 8,440
Reputation: 115,599

Post » Thu Jun 29, 2017 2:40 pm

Maybe..
Code: Select all
 c2_callFunction("name", ["param1", "param2"]);


Image
Image
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Thu Jun 29, 2017 7:39 pm

Guess there's no way to way to get around having to learn some code.
Image ImageImage
B
172
S
50
G
183
Posts: 8,440
Reputation: 115,599

Post » Thu Jun 29, 2017 8:20 pm

In index.html just place your code to be accessible globally

Image

In C2 just assign it to a variable or just get the value directly

Image
ImageImageImage
B
31
S
19
G
82
Posts: 1,039
Reputation: 46,207

Post » Thu Jun 29, 2017 9:47 pm

I didn't know you could get a variable like that.
Then again I'm not even sure Im using the right variable.

Thanks for the info guys.
Image ImageImage
B
172
S
50
G
183
Posts: 8,440
Reputation: 115,599


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot] and 8 guests