Copy link to clipboard
Copied
I made a game that is based on collecting stars. I have a problem that is at the moment of meeting 4 stars want to share passed to the next frame and removed all the frames tried funkcjii removeChild but message pops up. "TypeError: Error #1009: Cannot access a property or method of a null object reference."
|
Copy link to clipboard
Copied
you're trying to reference something that doesn't exist (when that line of code executes).
to find the problematic line of code, click file>publish as>click swf>tick 'permit debugging' and retest.
the line number will be in the error message.
in general, a line like this
this.parent.removeChildAt(0);
is suspicious and that error can be fixed by using:
if(this.parent && this.parent.numChildren>0){
this.parent.removeChildAt(0);
}
but that's still poor coding and prone to other problems
Find more inspiration, events, and resources on the new Adobe Community
Explore Now