I'm switching over from Actionscript 2.0 to Actionscript 3.0, and I'm missing a few key lines of code. Let's say I had a missile, and when it leaves the screen, in Actionscript 2, I would just use
removeMovieClip(this);
In Actionscript 3.0, I think I'm supposed to use
parent.removeChild(this);
Problem is, the code still runs. For example, I have a trace on frame 1, and then this code on Frame 30. Then when I run the program, it would run frame 1, then the object would "disappear", and then the trace happens again and when Frame 30 comes around again, I get TypeError: Error #1009: Cannot access a property or method of a null object reference.
So what am I doing wrong? Am I not deleting/etc properly? I realize that there are a few questions similar to this but they don't seem to have the answers I'm looking for. Thanks in advance.