开发者

Adobe Flash Professional - runtime error line number?

开发者 https://www.devze.com 2023-01-10 10:00 出处:网络
Compiled error show the line number well, but how about runtime line number? I often get error such as:

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

ArgumentError: Error #1063: Argument c开发者_开发百科ount 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?


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).


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号