Accessibility

Table of Contents

Debugging Client-Side Code in Flex Applications

Configuring the Flash Debug Player

The Flash Debug Player includes error reporting features that write error and trace information to a log file, flashlog.txt by default, on the local machine where the Flash player is running. The Flash Debug Player requires read and write access to the HOMEDRIVE and HOMEPATH location for error logging to work properly. On most Windows 2000 and Windows XP machines, the HOMEDRIVE value is set to the primary hard drive description, usually, C:. The HOMEPATH value is set to the default home directory, typically at \Documents and Settings\{your system user name}.

Depending on your Windows domain configuration and your local profile configuration, your HOMEDRIVE and HOMEPATH values may be set differently or not at all. If this is the case, you can try to reset or create the values for the local machine. The following instructions describe how to reset the values for your Windows environment.

  1. Right-click the My Computer icon on your desktop.
  2. Select Properties from the pop-up list.
  3. Select the Advanced tab.
  4. Click the Environment Variables button.
  5. Edit or create the HOMEDRIVE and HOMEPATH environment variables as necessary in the window for User Variables for {your system user name}.
  6. Restart your computer.

If setting the environmental variables does not reset the location for HOMEDRIVE and HOMEPATH, you may need to contact your Windows administrator to change your user profile so that HOMEDRIVE and HOMEPATH values are set to a location where you have read/write privileges.

To enable the Flash Debug Player’s error reporting capabilities, create the Flash debug configuration file. Create a file named mm.cfg, and put it in your HOMEDRIVE and HOMEPATH, for example, in c:\Documents and Settings\eanderson\mm.cfg. The following is a sample of settings you can put in an mm.cfg file that enables the player’s default error and trace logging.

TraceOutputFileEnable=1

ErrorReportingEnable=1

If the mm.cfg file is not located in the correct location, the player does not output error messages to the flashlog.txt file. The flashlog.txt file is stored in the same directory location as the mm.cfg file by default.

Note: The Flash Debug Player limits the number of warning and error messages written to the flashlog.txt file to 100 for each SWF invocation. To reset the default value, use the property MaxWarnings in the mm.cfg. The following example sets the maximum number of warnings to 500.

MaxWarnings=500

Note: Setting MaxWarnings=0 allows an unlimited number of error messages to be written to the flashlog.txt.

Use the TraceOutputFileName={path to location}/{customfilename} property to write the flashlog.txt to a custom location. The following example changes the location of the flashlog.txt to c:\ and changes the name of the file to flexlog.log

TraceOutputFileName=c:\flexLog.log