Hi
On the stage there’s an empty clip called mc1
in the library there’s a clip called with the class name Ball
now every frame this functions is executed:
mc1.addChild(new Ball())
inside ball, at frame ten:
this.parent.removeChild(this)
so this creates a bunch of balls on the stage, but after a while this error shows up:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Ball/frame10()
help?
Edit: ok by tracing Ball’s name I understand that even though the Ball is removed it continues to exist somewhere? Because the frames still play. Also I found out that you can check if parent is null before deleting, but I’d like to know why is this happening.