原文链接:http://www.riafan.com/article/flash/debug-with-flashlog.txt.html
调试Flash程序得安装Flash player的debuger版本,调试工具很多,如果不追求断点调试,可以使用flashlog.txt,这种方法不存在跨域、安全沙箱问题。
1. 新建mm.cfg文件,不同的操作系统放置的地方不同。
- Macintosh OS X:/Library/Application Support/Macromedia
- Windows 95/98/ME:%HOMEDRIVE%/%HOMEPATH%
- Windows 2000 & XP:C:/Documents and Settings/username
- Windows Vista & 7:C:/Users/username
- Linux:/home/username
2. 打开mm.cfg文件,新增两个参数设置:
ErrorReportingEnable=1
TraceOutputFileEnable=1
这样就打开了Flash player调试版的错误报告和跟踪输出信息功能。
注意:如果你的flash player的debug版本比较低(9,0,16,0或更早),请在mm.cfg里添加一条:
TraceOutputFileName=C:/Documents and Settings/username/Application Data/Macromedia/Flash Player/Logs/flashlog.txt。
Ok,运行一个带有trace语句或有错误的Flash程序,在flashlog.txt就能看到错误报告和跟踪输出信息了。同样,不同的操作系统放置的地方不同。
- Macintosh OS X:/Users/username/Library/Preferences/Macromedia/Flash Player/Logs
- Windows 95/98/ME/2000/XP:C:/Documents and Settings/username/Application Data/Macromedia/Flash Player/Logs
- Windows Vista & 7:C:/Users/username/AppData/Roaming/Macromedia/Flash Player/Logs
- Linux:/home/username/.macromedia/Flash_Player/Logs