Javascript can't call an object inside a function
<p>Sorry I am new to javascript. I am trying to call an object from inside a function to allow me to get varible from a flash file at set intervals. For some reason the object is not working inside the timer function.</p>

<pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
 &lt;title&gt;DIY Map&lt;/title&gt;

&lt;style&gt;
 * { margin:0; padding:0; }
&lt;/style&gt;

&lt;/head&gt;
&lt;body style="font-family:verdana;color:#999; background-image:url('bg.png'); background-repeat:no-repeat;"&gt;

&lt;script type="text/javascript" src="js/JavaScriptFlashGateway.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="js/Exception.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="js/FlashTag.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="js/FlashSerializer.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="js/FlashProxy.js"&gt;&lt;/script&gt;



&lt;script type="text/javascript"&gt;
 var uid = new Date().getTime();
 var flashProxy = new FlashProxy(uid, 'js/JavaScriptFlashGateway.swf');
    var tag = new FlashTag('world.swf?data_file=data.xml, 600, 325);
    tag.setFlashvars('lcId='+uid);
    tag.write(document);


&lt;/script&gt;

//flashProxy.call works here:
&lt;p&gt;&lt;a href="javascript:flashProxy.call('zoomOut');"&gt;Zoom Out&lt;/a&gt;

&lt;a href="javascript:flashProxy.call('refreshData','other_data.xml');"&gt;Get new data&lt;/a&gt;

&lt;p&gt;&lt;a href="javascript:flashProxy.call('getZoom');"&gt;getZoom&lt;/a&gt; | &lt;a href="javascript:flashProxy.call('getCoords');"&gt;getCoords&lt;/a&gt;&lt;/p&gt;



&lt;script type="text/javascript"&gt;
// Start the refreshing process

var seconds = 3;
var zoom;
var coords;

//timer loop
function checkmap()
{
//flashProxy doesn't work here
flashProxy.call('getCoords');     
flashProxy.call('getZoom');   
alert (coords);
alert (zoom);    


setTimeout('checkmap()',seconds * 1000);
}
checkmap();



//Returns results here:
function gotCoords(n)
{
    coords = n;
}
function gotZoom(n)
{
    zoom = n;   
}
&lt;/script&gt;
</code></pre>

<p>To clarify, I am trying to get the flashProxy.call('<em>*</em>*') to work in the checkmap() function. Thanks in advance.</p>
