title: How to access a js file from another js file in titanium studio android project
body: <p>I am new at titanium studio and working alloy mvc framework. I hv two js file in controller folder. one is index.js(created automatically when the project was created) and home.js. Now I want to open home.js on button event from index.js(like starting a new activity from another activity in eclipse android app). Here is my code:</p>
  
  <p>index.js:</p>
  
  <pre><code>function login_Click(e){
      Ti.include('home.js');
      hello();
  }       
  
  $.index.open(); 
  </code></pre>
  
  <p>where login_click(e) is a button onClick event.</p>
  
  <p>And home.js:</p>
  
  <pre><code>function hello(){
      //$.home.open();
      alert("Opened");
  }
  //exports.hello = hello;
  </code></pre>
  
  <p>but whenever i run it and click the button it gives the error</p>
  
  <p><strong>location:[25,1]alloy/controllers/home.js</strong></p>
  
  <p><strong>massage:uncaught reference error:module is not defined</strong></p>
  
  <p><strong>source:*module.export=controller;</strong></p>
  
  <p>Here is my alloy/controllers/home.js: </p>
  
  <pre><code>function Controller() {
      require("alloy/controllers/BaseController").apply(this, Array.prototype.slice.call(arguments));
      arguments[0] ? arguments[0]["__parentSymbol"] : null;
      arguments[0] ? arguments[0]["$model"] : null;
      var $ = this;
      var exports = {};
      $.__views.home = Ti.UI.createWindow({
          backgroundColor: "white",
          id: "home"
      });
      $.__views.home &amp;&amp; $.addTopLevelView($.__views.home);
      $.__views.label = Ti.UI.createLabel({
          text: "Hell Yeah",
          id: "label"
      });
      $.__views.home.add($.__views.label);
      exports.destroy = function() {};
      _.extend($, $.__views);
      $.home.open();
      _.extend($, exports);
  }
  
  var Alloy = require("alloy"), Backbone = Alloy.Backbone, _ = Alloy._;
  
  module.exports = Controller;
  </code></pre>
  
  <p>Plz help me here. I tried require() method. I tried to directly open using $.home.open(); But nothing worked. What do i have to do???? Thanx in advance....</p>