PDA

View Full Version : Flash Remoting Error Handling


fabioterracini
01-27-2003, 01:14 PM
Hello all,

I develop Flash Remoting + CFMX applications and I'm trying code a way so the application can be accessed in the intranet and the extranet, with the same code. This is, if can't establish a connection with the local server, connect with the remote server. The code i'm working on is below. Copy-and-paste in Flash for color-coding. :)

What happens is the following: If it connected to local server (intranet), it call's getMailings_Result() [automatically], and the application continues. If it can't establish a connection to the local server, it try to connect to the remote server, and it *really* connects (I see in output window that it received informations from the server), but it don't call the getMailings_Result() function, and the application don't continues as expected.

I hope I explained well and say thanks anticipatedly!



#include "NetServices.as"
if (inited == undefined) {
inited = true;

webservice_server = "TIKUNA";

NetServices.setDefaultGatewayUrl("http://tikuna/flashservices/gateway");
cfc_location = "contatos.qry.cfc_contatos";

gatewayConnection = NetServices.createGatewayConnection();
getMailingsServerCall = gatewayConnection.getService(cfc_location, this);
getMailingsServerCall.getMailings();
}

gatewayConnection.onStatus = function(status) {
// can't connect
// *try* to connect to remote server
trace("Can't connect to "+webservice_server);

webservice_server = "XINGU";

NetServices.setDefaultGatewayUrl("http://www.server.com.br/flashservices/gateway");
cfc_location = "intranet.contatos.qry.cfc_contatos";

gatewayConnection = NetServices.createGatewayConnection();
getMailingsServerCall = gatewayConnection.getService(cfc_location, this);
getMailingsServerCall.getMailings();
}

function getMailings_Result(result) {
// everything ok, connected at webservice
trace("Connected to "+webservice_server);
}

Lynx75
02-24-2003, 02:22 PM
ive seen u r a developer for remoting.
Im looking for info how to connect flash direct with mysql without php.

have u got any idea how?

thanks,bye

fabioterracini
02-25-2003, 11:09 AM
I don't think it's possible to connect it directly do a database, without a application server (like coldfusion or php).

Anyway, take a look at server-side actionscript.

Good luck!