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
168
S
50
G
163
Posts: 8,221
Reputation: 105,061

Post » Thu Jun 29, 2017 2:40 pm

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


Image
Image
Image
B
63
S
23
G
7
Posts: 1,480
Reputation: 10,796

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
168
S
50
G
163
Posts: 8,221
Reputation: 105,061

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
ImageImage
B
27
S
16
G
67
Posts: 934
Reputation: 38,072

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
168
S
50
G
163
Posts: 8,221
Reputation: 105,061


Return to How do I....?

Who is online

Users browsing this forum: jaytrott86, Lancifer and 6 guests