views:

72

answers:

3

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?

A: 

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

Jacob
A: 

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.

shortstick
+1  A: 

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

Juan Pablo Califano
+1 and removed my answer as it's clearly incorrect on quite a few aspects :)
BoltClock
@BoltClock. But it was quite right in that the debugger that comes with the Flash IDE sucks badly ;)
Juan Pablo Califano