views:

295

answers:

2

I have a Flash app with a PHP backend. Whenever there is a PHP error, I get the "Channel Disconnected before an acknowledgement was received" error message.

I'm getting ready to push my project to beta and I would prefer if this message said something more like "There was a PHP error, please log a bug" or something instead of a message they don't understand.

Anyone know of a way for me to change this error message? BTW I'm pretty much a noob when it comes to Flash programming so please be descriptive. Using Flash Builder 4 Beta 2.

+1  A: 

Just figured it out. In the declaration of my PHP service, there is a parameter called "fault", which is set the following by default:

fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)"

This is where we can change the message to whatever we want, by changing the message that is alerted.

Travesty3
+1  A: 

You should also be able to setup a fault handler in your flex app remote object. That way, you can actually report the problem automatically (inside "onFault").

<mx:RemoteObject id="ro" destination="AMFServer">
  <mx:method name="getSomething" fault="onFault(event)" 
        result = "onResult(event)" />
</mx:RemoteObject>
Good to know, thanks!
Travesty3