页面

2010年10月21日星期四

自己配置flash tracer

    在firefox下有个flashTracer插件,可以查看debug版下flash程序里的trace信息
    但如果没有firefox怎么办?这时候就得学会自己配置一下来查看trace信息了,它插件只是用adobe做出来的debug外置接口做了方便一点的输出台而已
    原理上应该是flash debug会在flash播放器里内置一个程序,这个程序可以跟踪AVM2中的执行过程,并能通过加载C:\Documents and Settings\username\mm.cfg文件读取一些配置信息,然后根据配置信息在跟踪代码执行过程当中把一些需要的信息写入到C:\Documents and Settings\username\Application Data\Macromedia\Flash Player\Logs\flashlog.txt文件当中去,所以要配置自己的trace控制台,只需要准备这个mm.cfg文件并写好里面的配置参数就好了,如果想让查看log信息方便点可以自己写个本地程序来读取flashlog.txt文件内容显示出来,当然肯定已经有第三方写出来了这样的工具了,Vizzy就是一个,项目 地址http://code.google.com/p/flash-tracer
    另外还要熟悉一些配置参数
        
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 theErrorReportingEnable 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 TraceOutputFileEnableproperty to 0.

The default value is 0.

TraceOutputFileName

Sets the location of the log file. By default, the debugger version of Flash Player writes error messages to a file named flashlog.txt.

Set TraceOutputFileName to override the default name and location of the log file by specifying a new location and name in the following form:

TraceOutputFileName=<fully qualified path/filename>

On Mac OS X, you should use colons to separate directories in the TraceOutputFileName path rather than slashes.

Note: Beginning with the Flash Player 9 Update, Flash Player ignores the TraceOutputFileName property and stores the flashlog.txt file in a hard-coded location based on operating system. For more information, see the section on log file location listed below.


http://livedocs.adobe.com/flex/3/html/help.html?content=logging_04.html
另外还有一些参数可以输出代码执行中的调用堆栈啦什么的,参数给忘记了,想起了再补上

没有评论:

发表评论