Question
The amazing repeating event!
Okay, I'm still working on the problem I've been on for three
days. I have a call to main.asc and it returns a string. (I only
care
that it returns, not
what.) Through your help, I am successfully calling the
routine in main.asc. But something really weird is happening now.
The return function is getting called even when 1) the connection to the FMS is physically broken, and 2) I remove the return statement from the function in main.asc!
Here's the routine (I have removed my debugging statements for clarity.)
private function ConnectionTest ()
{
_root.application.EventDesktop.m_ConnectionTestResult = false;
//Response function for the heartbeat call above
var ESMSIsConnected = function( )
{
_root.application.EventDesktop.m_ConnectionTestResult = true;
}
if (_root.session.flashComm.m_connection == null)
{
_root.application.EventDesktop.m_tries++;
}
else
{
_root.application.EventDesktop.m_tries = 0;
_root.session.flashComm.m_connection.call( "heartbeat" , new ESMSIsConnected());
}
_root.application.EventDesktop.m_ConnectionTestResultID = setInterval(_root.application.EventDesktop.ConnectionTestResult, 2000);
}
In main the heartbeat function looks like this:
Client.prototype.heartbeat = function()
{
//return "HI!";
}
Now, with the return statement commented out I would not expect the ESMSIsConnected function to ever get executed. Not so - it runs the same with or without the return in heartbeat. What's more, when I pull the network cable, I still get ESMSIsConnected executing.
Obviously I'm still missing some critical concept. Can anyone help?
The return function is getting called even when 1) the connection to the FMS is physically broken, and 2) I remove the return statement from the function in main.asc!
Here's the routine (I have removed my debugging statements for clarity.)
private function ConnectionTest ()
{
_root.application.EventDesktop.m_ConnectionTestResult = false;
//Response function for the heartbeat call above
var ESMSIsConnected = function( )
{
_root.application.EventDesktop.m_ConnectionTestResult = true;
}
if (_root.session.flashComm.m_connection == null)
{
_root.application.EventDesktop.m_tries++;
}
else
{
_root.application.EventDesktop.m_tries = 0;
_root.session.flashComm.m_connection.call( "heartbeat" , new ESMSIsConnected());
}
_root.application.EventDesktop.m_ConnectionTestResultID = setInterval(_root.application.EventDesktop.ConnectionTestResult, 2000);
}
In main the heartbeat function looks like this:
Client.prototype.heartbeat = function()
{
//return "HI!";
}
Now, with the return statement commented out I would not expect the ESMSIsConnected function to ever get executed. Not so - it runs the same with or without the return in heartbeat. What's more, when I pull the network cable, I still get ESMSIsConnected executing.
Obviously I'm still missing some critical concept. Can anyone help?
