I would like to know how the variable scope works when Ti.include.
I made application on titanium 2.*
var x = '12'
Ti.include('lib.js');
in lib.js
Ti.API.info(x) //it shows 12
However, now I am transferring this code into alloy
in app/controllers/index.js
var x = '12'
Ti.include('/mylib/lib.js');
in app/ssets/mylib/lib.js
app/ssets/mylib/lib.js // it says can't find variable x.
How can I make the global variable which is available in both file??