Global var in Alloy.js

263 Views Asked by At

I have an older app with Appcelerator Titanium SDK 5.0 and i need put in Titanium SDK 7.5. This app run in Android.

In Alloy.js file is defined several var, then i need use it in several .js files

Alloy.js

var Temperaturas[];
var Confort;

Index.js

Alloy.Globals.Temperaturas[0]=25;
Alloy.Globals.Temperaturas[1]=23;
Alloy.Globals.Confort=21;

Programacion.js

Alloy.Globals.Temperaturas[0]=27;
Alloy.Globals.Temperaturas[1]=27;
Alloy.Globals.Confort=22;

The problem is var Confort run fine, but Temperaturas don't

How i can do it??

Thanks

1

There are 1 best solutions below

0
Jórdan Luiz Bisato On BEST ANSWER

Don't use var on alloy.js.

Change var Temperaturas[] by Alloy.Globals.Temperaturas = [] on alloy.js