Name

NetConnection.getDebugConfig( ) Method

Synopsis

                     myNetConnectionObject.getDebugConfig( )

Returns

A NetDebugConfig object containing the currently subscribed events.

Description

The getDebugConfig( ) method is used to programmatically retrieve the currently subscribed events for the NetConnection Debugger panel.

Example

The following code shows the basic syntax of the getDebugConfig( ) method and how it might be used:

#include "NetDebug.as"
#include "NetServices.as"
NetServices.setDefaultGatewayURL("http://localhost/flashservices/gateway");
var my_conn = NetServices.createGatewayConnection( );
var my_service = my_conn.getService("myService", this);
my_conn.trace("Service Object created.");

function onStatus (error) {
  // Show error message
  trace(error.description);
  // Get the NetDebugConfig object
  var debugConfig = my_conn.getDebugConfig( );
  // Iterate through the properties of the NetDebugObject
  for (i in debugConfig) {
    trace (i + ":" + debugConfig[i]);
    // If the property is an object itself, iterate through its properties
    for (j in debugConfig[i]) trace ("   " + j + ":" + debugConfig[i][j]);
  }
}

In the code, a NetDebugConfig object is created when a service call fails, and the properties of the object are written to the Output window. Note that some of the properties of the NetDebugConfig object are objects themselves, so they will be written to the Output window as [object Object]. The properties give you information about your current debug settings.

See Also

NetConnection.getDebugId( ...

Get Flash Remoting: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.