1

我正在使用 Flex SDK 中的命令行工具开发一个 AS3 应用程序。我的工作流程是:

  1. 写代码
  2. 编译mxmlc
  3. 在最喜欢的网络浏览器中运行 SWF 文件
  4. 重复

第二步捕获编译时错误,但运行时错误和警告呢?和trace()输出?我怎么能看到呢?

我没有使用任何具有调试功能的 IDE。

4

3 回答 3

3

获取 Firefox 的 Flash 播放器和 Firebug 的调试版本,然后您可以在控制台中看到跟踪和错误。

当异常处理程序未捕获的运行时错误发生时,您将收到一个弹出窗口,告诉您有关该错误的信息。

为什么不获取http://www.flashdevelop.org/?它是免费的,它具有调试、分析和所有其他您可以从 IDE 获得的好处。

于 2012-07-28T23:01:36.000 回答
1

Although the Flash debugger is a pretty good choice. I would personally suggest Monster Debugger. It is a great debugger with a very intuitive user interface and it has a plethora of features that make debugging extremely easy.

于 2012-07-29T13:32:20.840 回答
0

Flash 播放器调试器将输出写入trace()flashlog.txt 文件。它的位置是硬编码的,并且在不同的系统上是不同的。在 Linux 上,它位于 ~/.macromedia/Flash_Player/Logs/flashlog.txt。为了让调试器实际写入该文件,您需要另一个文件 mm.cfg,它的位置和名称再次被硬编码。它应该在 ~/mm.cfg 中。它可能包含许多不同的选项,但您感兴趣的是ErrorReportingEnable=1.

然后,您可以$ tail -f ~/.macromedia/Flash_Player/Logs/flashlog.txt查看文件写入的进度。

请注意,目录和文件必须可由运行播放器的用户写入。如果不是这种情况,Flash 播放器将不会发出任何警告,并且会静默失败。

Also note that if you are happened to be on Linux, then there isn't a 64-bit version of a debugger player... However, the player runs fairly well under Wine, the Windows version that is.

You may debug using commandline debugger found in SDK. it's called fdb (fdb.exe or in Apache Flex fdb.bat on Windows). It has similar to gdb interface, can do breakpoints, some runtime code evaluation, disassemble functions, look up stack frames and their variables and most of the other stuff you'd expect a debugger to do. I'm usually running it from Emacs, but I would imagine that running it from Vi[m] or whatever editor you are using shouldn't be a problem...

If you were using Emacs, it is actually possible to hook up Flymake to a part of the SDK that does syntax checking while you type. You can find more info on how to do that here: http://www.flashdevelop.org/community/viewtopic.php?f=13&t=9238 (thanks Philippe).

于 2012-07-29T05:58:51.220 回答