Hi,
I'm delevoping a flash remoting project using ColdFusion MX7 and Flash 8 Pro.
Just by accident, I had forgotten to start my ColdFusion Application server
and while testing a file I recieved a netConnection.trace error saying that
Flash could not open the gateway flashservices URI, and my app ground to a halt.
Now, when the server is started, no problems of course, but still... what if?
I did some research and couldn't find much on the subject. Most of the things
I read mentioned that there was no onStatus handler for the service connection.
So I'm here to ask, what is the general feeling around this? How are people
handling this? Are they?
If flash can trace that there has been an error, why can't I catch it and
handle it?
Anyway, if you have any ideas, I'd love to hear them. Right now I feel like
there is a potential error in my code that a user wouldn't be able to recover
from without a complete refresh, and I'm not super pumped about it.
- J
_AlbertG_ - 03 Jan 2007 23:28 GMT
Hi.
Flash remoting has an event that is dispatched when can not connect to the
service. If you have...
//-------
pc.responder = new RelayResponder(this, onResult, onFault);
//-------
you must defined 2 functions. The first one, is called when the connection was
succesful, the second when is was failed.
Each function receive a parameter data typed Result and Fault event.
//------------
function onResult(re:ResultEvent):Void{
trace(re.result)
}
function onFault(fe:FaultEvent):Void{
trace(fe.fault.faultcode);
trace(fe.fault.faultstring);
}
//-------
This is how you can handle the errors.