Grabbing a variable from another js file
<p>example :</p>

<p>original file code:</p>

<pre><code>var drawMap = function() {
    for(i=0;i&lt;map.length;i++){
        for(j=0;j&lt;map[i].length;j++){
            var drawTile= map[i][j];
            var xpos = (i-j)*tileH + mapX;
            var ypos = (i+j)*tileH/2+ mapY;
            ctx.drawImage(tileImg[drawTile],xpos,ypos);
        }
    }   
    return {
        xpos: xpos,
        ypos: ypos
    }
}
</code></pre>

<p>new code file:</p>

<pre><code>var draw = function(ctx) {
    alert(map.drawMap.xpos);
};
</code></pre>

<p>the value for xpos in the new code file always comes up undefined... help?</p>
