How do I use a global variable in javascript function

Get help using Construct 2

Post » Tue Sep 15, 2015 12:19 am

Hi,

I'm using the CallJS plugin presently to call functions I have in an external script in the following way:
Code: Select all
callJS: execute myFunction();

myFunction is located in someScript.js

This is currently working well, however I want to be able to pass in global variable as parameter like so:
Code: Select all
callJS: execute myFunction(someGlobalVariable);


The reason for this is I want to use the global variable in further scripts which eventually will be passed to my API so that I can store data and scores. How can I do this?

Any help will be much appreciated.
Last edited by idny99 on Tue Sep 15, 2015 2:27 pm, edited 2 times in total.
B
3
Posts: 4
Reputation: 183

Post » Tue Sep 15, 2015 2:26 pm

Bump :)
Would it be better to write a plugin to handle this?
B
3
Posts: 4
Reputation: 183


Return to How do I....?

Who is online

Users browsing this forum: PratikIngle, RIDETHEPIG and 3 guests