Subscribing to event in javascript
<p>I have 2 different Javascript files.</p>

<p>hexagon.js</p>

<pre><code>  function HexagonGrid(canvasId, radius) {
this.radius = radius;

this.height = Math.sqrt(3) * radius;
this.width = 2 * radius;
this.side = (3 / 2) * radius;

this.canvas = document.getElementById(canvasId);
this.context = this.canvas.getContext('2d');

this.canvasOriginX = 0;
this.canvasOriginY = 0;

this.canvas.addEventListener("mousedown", this.clickEvent.bind(this), false);

this.hexGridList = {};
};

  HexagonGrid.prototype.clickEvent = function (e) {
    var mouseX = e.pageX;
    var mouseY = e.pageY;

    var localX = mouseX - this.canvasOriginX;
    var localY = mouseY - this.canvasOriginY;

    **var tile = this.getSelectedTile(localX, localY);**

    if (tile.column &gt;= 0 &amp;&amp; tile.row &gt;= 0) {

    //find
    //this.hexGridList['row' + tile.row + 'column' + tile.column]. 

    var drawy = tile.column % 2 == 0 ? (tile.row * this.height) + this.canvasOriginY + 6 : (tile.row * this.height) + this.canvasOriginY + 6 + (this.height / 2);
        var drawx = (tile.column * this.side) + this.canvasOriginX;

        this.drawHex(drawx, drawy - 6, "rgba(110,110,70,0.3)", "");
    } 
};
</code></pre>

<p>Mainpage.js</p>

<pre><code>    &lt;script src="Hexagon.js"&gt;&lt;/script&gt;
     var hexagonGrid = new HexagonGrid("HexCanvas", 50);
</code></pre>

<p>So, my mainpage is the page that is running, and I am trying to return the tile on the bolded line in hexagon.js back to mainpage.js on mouse click. How do I get the tile object from hexagon.js to the mainpage.js page on mouse click?</p>