flashlog.txt配置

本工具特点:
1、简单又方便,无需像其他debuger工具那样要在flash中添加多余的调试代码,只需简单的trace()就OK!
2、as2,as3均可调试。
3、不存在跨域、安全沙箱问题。
4、不管你的flash运行在什么程序上,浏览器还是其他应用程序。(除开AIR)都可以获取trace信息。

Flash player的debuger版本有个功能,可以把flash文件中的trace信息输出到一个名为flashlog.txt的文本文件中,而且不管当前运行的flash所在的域如何或者是嵌在其他应用程序中,这些trace信息一律都会被记录在flashlog.txt中。因此我们可以利用这一特性,调试其他flash调试工具无法调试的flash程序。

首先要确认你的机器里安装了Flash player的debuger版本,检测办法:访问这里,右键点击中间那个flash(文字:Adobe Flash Player is installed.),如果在右键菜单中有“debuger”或者“调试器”的选项,则说明你已经安装了debuger版本。一般的如果你安装了flash 8或者flash cs3的话,都会自动安装了debuger版本。

接下来,新建一个mm.cfg文件。地址为:C:\Documents and Settings\username\mm.cfg,其中username为你的XP系统用户名,比如Administrator。打开mm.cfg,输入:

ErrorReportingEnable=0 
TraceOutputFileEnable=1 

然后,创建一个flashlog.txt文件。地址为:C:\Documents and Settings\username\Application Data\Macromedia\Flash Player\Logs\flashlog.txt,其中Logs目录需要自己创建的。这样,你机器上的flash文件里的trace信息就会保存在此文件中。但是,需要注意的是此文件只会保存最后打开的flash文件的trace信息。

注意:如果你的flash player的debug版本比较低(9,0,16,0或更早),请在mm.cfg里添加一条:
TraceOutputFileName=C:\Documents and Settings\username\Application Data\Macromedia\Flash Player\Logs\flashlog.txt


为了使用方便,我做了一个监控和读取flashlog.txt文件内容的小工具: FlashTail。在你调试的时候,只要先把它打开,然后再打开需要调试的flash,FlashTail中就会把你的trace信息都显示出来。

本文地址:http://www.flashrek.com/article.asp?id=43

Configuring the debugger version of Flash Player

Revised 2/4/2008: Added URL for obtaining debugger version of Flash Player.

You use the settings in the mm.cfg text file to configure the debugger version of Flash Player (available from www.adobe.com/support/flashplayer/downloads.html). You must create this file when you first configure the debugger version of Flash Player. The location of this file depends on your operating system. The following table shows where to create the mm.cfg file for several operating systems.

Revised 4/12/2007: Corrected default location of mm.cfg file on Linux.
Revised 2/4/2008: Added location for Windows 95/98/ME and Windows Vista, corrected location for Windows 2000 and Linux.

Operating system

Create mm.cfg file in this directory

Macintosh OS X

MacHD:Library:Application Support:macromedia:

Microsoft Windows Vista

C:\Users\user_name\

Microsoft Windows 2000/XP

C:\Documents and Settings\user_name\

Microsoft Windows 95/98/ME
%HOMEDRIVE%\%HOMEPATH%\

Linux

/home/user_name

The following table lists the properties that you can set in the mm.cfg file:

Property

Description

ErrorReportingEnable

Enables the logging of error messages.

Set the ErrorReportingEnable property to 1 to enable the debugger version of Flash Player to write error messages to the log file. To disable logging of error messages, set the ErrorReportingEnable property to 0.

The default value is 0.

MaxWarnings

Sets the number of warnings to log before stopping.

The default value of the MaxWarnings property is 100. After 100 messages, the debugger version of Flash Player writes a message to the file stating that further error messages will be suppressed.

Set the MaxWarnings property to override the default message limit. For example, you can set it to 500 to capture 500 error messages.

Set the MaxWarnings property to 0 to remove the limit so that all error messages are recorded.

TraceOutputFileEnable

Enables trace logging.

Set TraceOutputFileEnable to 1 to enable the debugger version of Flash Player to write trace messages to the log file. Disable trace logging by setting the TraceOutputFileEnable property to 0.

The default value is 0.

TraceOutputFileName

Note: Beginning with the Flash Player 9 Update, Flash Player ignores the TraceOutputFileName property.

Sets the location of the log file. By default, the debugger version of Flash Player writes error messages to a file named flashlog.txt, located in the same directory in which the mm.cfg file is located.

Set TraceOutputFileName to override the default name and location of the log file by specifying a new location and name in the following form: On Macintosh OS X, you should use colons to separate directories in the TraceOutputFileName path rather than slashes.

TraceOutputFileName=<fully qualified path/filename>

The following sample mm.cfg file enables error reporting and trace logging:

ErrorReportingEnable=1 TraceOutputFileEnable=1

Subtopics

Log file location

Log file location

The default log file location changed between the initial Flash Player 9 release and the Flash Player 9 Update. In the initial Flash Player 9 release, the default location is the same directory as the mm.cfg file and you can update the log file location and name through the TraceOutputFileName property.

With the Flash Player 9 Update, you cannot modify the log file location or name. The filename is flashlog.txt, and its location is hard-coded, depending on your operating system. The following table shows the flashlog.txt file location:

Revised 2/4/2008: Corrected default locations for log file.

Operating system

Location of flashlog.txt

Macintosh OS X

MacHD:Users:user_name:Library:Preferences:Macromedia:Flash Player:Logs:flashlog.txt

Microsoft Windows Vista

C:\Users\user_name\AppData\Roaming\Macromedia\Flash Player\Logs\flashlog.txt

Windows 95/98/ME/2000/XP

C:\Documents and Settings\user_name\Application Data\Macromedia\Flash Player\Logs\flashlog.txt

Linux

/home/user_name/.macromedia/Flash_Player/Logs/flashlog.txt

你可能感兴趣的:(linux,windows,XP,Microsoft,Flash)