Adobe Flash Professional - 运行时错误行号?

发布于 2024-09-12 22:38:49 字数 234 浏览 9 评论 0原文

编译错误很好地显示了行号,但是运行时行号又如何呢? 我经常收到如下错误:

ArgumentError:错误#1063:参数 计数不匹配 卡::游戏/myfunction()。预计 0, 得到 1

并且如果我的 AS3 中有很多 myfunction() 。如果我必须一项一项地检查,那就太令人沮丧了。

一个行号不是一定能节省很多时间吗?

Compiled error show the line number well, but how about runtime line number?
I often get error such as:

ArgumentError: Error #1063: Argument
count mismatch on
cards::Game/myfunction(). Expected 0,
got 1

and if I have many myfunction() in my AS3. It would be frustrating if I have to check one by one.

Isn't a line number would definitely save a lot of times?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

折戟 2024-09-19 22:38:49

转到发布设置,选择“flash”选项卡并选中“允许调试”。这将为您提供更详细的堆栈跟踪,包括行号(当然,如果可用)。默认情况下此选项未选中。发布部署时,建议取消选中此选项(这与在 Flex Builder 和其他 Actionscript IDE 中构建 bin-debug 和 bin-release 版本相同)。

Go to publish settings, select the "flash" tab and check "Permit debugging". This will give you more verbose stack traces, including line numbers (when available, of course). This options is unchecked by default. When publishing for deployment, it's advisable to uncheck this option (it's the same as building bin-debug and bin-release versions in Flex Builder and other actionscript IDEs).

以可爱出名 2024-09-19 22:38:49

您可能想尝试使用 Flash Builder 4 作为 Flash 的 IDE。它将为您提供更好的调试工具。

You may want to try using Flash Builder 4 as your IDE for Flash. It will provide you much better tools for debugging.

堇年纸鸢 2024-09-19 22:38:49

跟踪行的要点是,它按顺序向您显示已调用的命令列表,以便您可以具体跟踪调用失败的位置(以及希望原因)(例如事件 -> 事件处理程序 -> 函数 - >其他功能->错误)。您不应该在同一作用域内具有相同的函数名称,因此如果您学会阅读跟踪,那么总是很容易找到它。例如,您抛出的错误意味着您在类 cards.Game 中调用了函数 myfunction(),变量过多。
诚然,行号在某些情况下很有用(主要是“空引用”错误),但使用trace()命令通常可以很快地得到它。

the point of the trace line is that it shows you the list of commands that has been called, in order, so you can track specifically where (and hopefully why) the call failed (eg event -> event handler -> function -> other function -> error). you should not have the same function names within the same scope, so it is always fairly easy to find if you learn to read the trace. for instance the error you have thrown means that you have called the function myfunction() in class cards.Game with too many variables.
The line number would admittedly be useful in some cases (mainly 'null reference' errors), but using the trace() command you can usually get it down quite quickly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文