NetDebug.as

The NetDebug.as file is not a required part of Flash Remoting, but it is required if you want to use the NetConnection debugger. The file can be included in your movie during debugging but should be removed from the code before deployment, as it adds considerable weight to the final movie.

If your application is complex, you can include a dummy MyDebugFile.as file in each of your .fla files as follows:

#include "MyDebugFile.as"

This dummy MyDebugFile.as file should contain one line:

// #include "NetDebug.as"

If the line is commented out (as indicated by the prepended slashes), the NetDebug.as file is not included. If you uncomment the line, the NetDebug.as file is included. This technique circumvents the lack of a conditional #include in ActionScript. It makes it easier to activate and deactivate NetConnection debugging in a single place, without the need to edit multiple .fla files.

By including the NetDebug.as file, you are also including the following files:

NetDebugHelpers.as
NetDebugConfig.as
NetDebugEvents.as
NetDebugNetConnection.as
NetDebugLocalConnection.as
NetDebugImpl.as

These files form the code base for the NetConnection debugger and the NetDebug class that you can utilize for debugging.

The NetDebug class exposes these methods, which can be called from an instance of the NetConnection object:

trace( )

Displays an object to the NetConnection Debugger panel. This can be any ActionScript object.

getDebugConfig( )

Gets the configuration object of NetDebug (NetDebugConfig ...

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.