Just using AS3 's friend.
May often encounter
' Typeerror:error #1009: Cannot access properties or methods of null object references. "
The reason for this problem is simple, the common is "object is null", "property does not exist", "method does not exist."
Take a look at the following example:
1, var List:array;
2, Trace (list.length)
As the list is instantiated, we call the attributes of his length. Ctrl+enter run. The following error has occurred
1. Typeerror:error #1009: Cannot access properties or methods of null object references.
2. At _fla::maintimeline/frame1 ()
PS: I write on the frame, so the function name is frame1, the class name is Maintimeline.
In fact, it is very good to solve the problem.
But the code hints didn't tell us which object, which attribute, which method,
Not even a single line told us.
Just tell us which function it is,
If there are only two lines of code like above ... Well, that's a good solution, though.
Achievable situation may be 10 lines ~ 20 Lines ~
Then you may have to use the exclusion of return or try ... A step-by-step solution ...
Tired ~ above is preface ... Can skip directly ...
Today we introduce a simple but not-so-common way ... Can solve the above problem ....
or the previous code
1, var List:array;
2, Trace (list.length)
But we don't use Ctrl+enter to run
We use Ctrl+shift+enter to run
After the Run Debug window appears with the following content
1, trying to start and connect to the player using the URL c:docume~1*locals~1temp unnamed -1.swf
2. The number of bytes after decompression is [SWF] c:documents and settings*local settingstemp unnamed -1.swf-1970 bytes
3. Typeerror:error #1009: Cannot access properties or methods of null object references.
4, at _fla::maintimeline/frame1 () [_fla. Maintimeline::frame1:2]
And look in the middle of the IDE.
Has told us in detail which line is the problem ...
This allows you to quickly navigate to the wrong number of rows ...
Then it's OK to deal with the problem of the line ...
PS: Debugging functions In addition to just said the function, there are many more practical functions, variable view, breakpoint debugging, we can try more, to debug debugging has a great help!