Anyone who uses AMF, dpdk.nl’s ActionScript 3.0 remoting library is a fantastic robust, remoting service.
There are “rare” events that I didn’t consider after making several projects with it. These events, such as a connection issue, results in the user watching a spinning wheel for 10 minutes not realizing the app has jammed.
Inside nl.dpdk.services.remoting.RemotingEvent you’ll see four ‘enums’:
- ERROR_NETSTATUS
- ERROR_IO
- ERROR_ASYNC
- ERROR_SECURITY
- ERROR_TIMEOUT
You’ll want to take care of each event, but ERROR_NETSTATUS and ERROR_TIMEOUT should be suffice. Here’s how you deal with ERROR_NETSTATUS:
var service:RemotingProxy = new RemotingProxy('http://localhost/', 'domain.MyService', ObjectEncoding.AMF3);
service.addEventListener(RemotingEvent.ERROR_NETSTATUS, onNetError);
public function onNetError(event: RemotingEvent) : void {
errorCallBack('Connection Error! ' + event.getMessage());
}
This way you can deal with connection errors, etc. A user would likely close your site and never come back if it’s freezing all the time. Giving the user the option of resending the data would keep them there, and perhaps jiggle their cat 5′s.