Flash Remoting MX provides several objects and methods that let you control the information that appears in the NetConnection Debugger. These tools include the following:
NetDebug.trace method, to display trace messages in the debugger
The NetDebug.trace method displays a trace message in the NetConnection Debugger. For example, the following trace method displays a trace message with the text "I just created myService." in the NetConnection Debugger:
NetDebug.trace("I just created myService.");
The argument to the trace method is not limited to a string. It can be a Flash Object. For example, you can use the trace method to report the values of multiple variables, as in the following code:
NetDebug.trace({arg1value:arg1, arg2value:arg2});
If your application uses multiple connections, you can use the debugging-related methods of each NetConnection object to debug the individual connections.
The setDebugID method creates an ID that is displayed in the NetConnection Debugger output for events associated with the specific NetConnection object; for example:
gatewayConnection.setDebugID("Gateway Connection");
You can send a trace message that includes the connection ID by using the GatewayConnection object's trace method, as in the following example:
myGatewayConnection.trace("I just created myService2 over this connection.");
Additionally, the getDebugID method returns the ID set by the setDebugID method, and the getDebugConfig method returns the NetDebugConfig object for the specific connection. For more information on using the getDebugConfig method, see the following section, "Configuring debugger output in ActionScript" .
You can specify the information that the NetConnection Debugger displays by selecting options on the debugger Filters panel, or you can do it programmatically in ActionScript. This document describes how to use ActionScript. For information on using the Filters panel, see the Flash online Help.
In ActionScript, you configure NetConnection Debugger output for each connection individually. As a result, if your Flash Remoting application has multiple connections, you can configure different levels of debugging detail for each connection.
getDebugConfig method to get the connection's NetDebugConfig object.
You can combine both steps in a single line, as in the following example, which turns off application server AMF debugging messages:
gatewayConnection.getDebugConfig().app_server.amf = false;
Note: You can only use this technique to select or disable individual event types. You cannot use a single call to select or disable all debugging information for the client, application server, or Flash Communication Server.
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flashremoting/mx/Using_Flash_Remoting_MX/DebugActionScript4.htm
Comments
Wasey said on Sep 24, 2003 at 1:10 PM : henze9@hotmail.com said on Sep 30, 2003 at 1:30 AM : DulosIX said on Oct 25, 2003 at 5:43 AM :