View comments | RSS feed

Using the NetConnection Debugger in ActionScript

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:

Using the NetDebug.trace method

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});  

Using connection-specific debugging methods

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" .

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.

To configure debugging output:

  1. Use the NetConnection getDebugConfig method to get the connection's NetDebugConfig object.
  2. Set the required property of the NetDebugConfig object. The table in "NetConnection event types" specifies the properties you can set.

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.

Comments


Wasey said on Sep 24, 2003 at 1:10 PM :
their should be more info on
how can one setup netservice function in a non wwwroot website?
henze9@hotmail.com said on Sep 30, 2003 at 1:30 AM :
god I wish you guys at macromedia had better debuggin
DulosIX said on Oct 25, 2003 at 5:43 AM :
how do I trace things from the ColdFusion side to the NetConnection Debugger?

 

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