I am new in Titanium 3.x and I have made my first simple Titanium project.It just opens new window using another JS file. I write code in index.js like below. and I create new js file "createnew.js" in app/controllers/.
//////////////////////////////////////
button.addEventListener('click',function(e)
{
var childWindow = Ti.UI.createWindow({
url: 'createnew.js'
});
childWindow.open();
});
///////////////////////////////////////
// createnew.js
///////////////////////////////////////
var self = Ti.UI.createWindow();
var overview = Ti.UI.createView({
width: Ti.UI.FILL,
height: Ti.UI.FILL,
backgroundColor: 'yellow'
});
self.add(overview);
self.open();
When run app, if I click button, the red error window appears in simulator , says that cannot open createnew.js file, cannot find such file or directory.
How can I solve this problem?
My aim is to make every page of the Mobile app as different Js file, and when It goes to the page, I can just use calling createWindow() to load Js file. Please help me .