NetDebugConfig.setDebug( )

NetDebugConfig.setDebug( ) MethodFlash 6

sets the state of NetConnection debugging
myConnection.getDebugConfig( ).setDebug(setting)

Arguments

setting

true or false value to turn debugging on or off.

Description

The setDebug( ) method is used to turn debugging on or off programmatically. This can be useful if you are testing an application and need a way to turn debugging on only at certain times, such as when a problem occurs. This is a good way to limit logging so that errors aren't lost in a flood of status messages, although you can turn debugging on and off for individual events using the properties in Table 15-2.

The NetDebug.as file must be included in order to use the setDebug( ) method.

Example

The following code shows the basic syntax of the setDebug( ) method:

#include "NetServices.as"
#include "NetDebug.as"

if (connected == null) {
  connected = true;
  NetServices.setDefaultGatewayUrl("http://127.0.0.1/flashservices/gateway");
  var my_conn = NetServices.createGatewayConnection( );
  var my_service = my_conn.getService("com.oreilly.frdg.searchProducts");
  my_conn.getDebugConfig( ).setDebug(true);
}

Bugs

At the time of this writing, this method has no effect on the debugging mode. It has been removed from Macromedia's online documentation at http://livedocs.macromedia.com/flashremoting/mx/Using_Flash_Remoting_MX/asDict4.htm#91933 and should be considered unsupported until Macromedia updates their documentation.

See Also

The NetDebug object, Table 15-2 under the NetDebugConfig object, NetDebugConfig.getDebug( ); Chapter 13



    Part III: Advanced Flash Remoting