(转) Debugging Flex applications with mm.cfg and flashlog.txt

60 篇文章 0 订阅

When working with Flex applications, it may useful to see the output from the trace() function. Well, the good news is that if you have the debug version of the Flash Player installed, it is really easy to redirect the trace() output to an external file which can you browse using any text editor.

There are lots of excellent online resources for this already, but here is a brief run-down…

 

Create a file named “mm.cfg” in one of the following locations:

  • Windows; C:/Documents and Settings/username/mm.cfg
  • OSX; /Library/Application Support/Macromedia/mm.cfg
  • Linux; home/username/mm.cfg

Open the newly created mm.cfg file in a text editor and add the following text:

ErrorReportingEnable=1
TraceOutputFileEnable=1

The flashlog.txt file will be created in the following location:

  • Windows; C:/Documents and Settings/username/Application Data/Macromedia/Flash Player/Logs/flashlog.txt
  • OSX; /Users/username/Library/Preferences/Macromedia/Flash Player/Logs/flashlog.txt
  • Linux; home/username/Macromedia/Flash_Player/Logs/flashlog.txt

For more information see “Logging”, “Configuring the debugger version of Flash Player” and “Configuring the debugger version of Flash Player to record trace() output” in the Flex 2.0.1 documentation.

You can also check out the “Debugging Client-Side Code in Flex Applications” article in the adobe Flex Developer Center (although note that the article was written March, 15 2004, and some information may not be 100% accurate anymore).

If you are still having problems, check out the following adobe Technote on “Troubleshooting tips for flashlog.txt not being generated”.

For more information, check out Mark Walters’s excellent post over on digitalflipbook.com, “Trace from the browser, using standard trace()”.

Frequently Asked Questions

Q: How do I know if I have the debug version of the Flash Player already installed?
A: Finding your Flash Player version, and whether or not your Flash Player is a debug version is done by checking the version and isDebugger properties of the flash.system.Capabilities class.

 

Q: Where can I download a debug version of the Flash Player if I don’t have one already installed?
A: You can download nightly builds of the Flex 3 SDK from the “Adobe Labs – Flex 3 Software Development Kit” page. Simply download and extract a ZIP file, and go to the following directory: “flex_sdk_3.zip/runtimes/player”. In this folder you should find three subfolders: “lnx”, “mac”, and “win” for the Linux, Macintosh and Windows operating systems respectively. Navigate to your appropriate folder/operating system and install away!

If you have the Flex Builder 3 public beta installed, you can navigate to the following directory on a Windows system to find the various Flash Player versions (standalone, ActiveX, Mozilla): “C:/Program Files/Adobe/Flex Builder 3/sdks/moxie/runtimes/player/win”. If you don’t have the Flex Builder 3 beta installed, you can download it from “Adobe Labs – Adobe Flex Builder 3 Public Beta”.

These folder names/locations could change with any future beta/nightly build, but I’ll try and keep them updated. If you notice they are no longer correct, leave a message in the comments and I will investigate/reply.

Hopefully that about covers it. Until next time, be safe and happy Flexing!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值