TypeError: Error #1009: Cannot access a property or method of a null object reference. at main/ElegirNivel()[main::frame1:7]
I'm starting a game on this platform I saw a video where it was that code and never gave faults but to me if when I I to chop the main button appears to me:
TypeError: Error # 1009: Cannot access a property or method of a null object reference.
At main/ElegirNivel () [Main:: frame: 7]
This is the code of the button:
Import Flash. MouseEvent;
Stop ();
Boton100. Addeventlistener() (mouseevent. click, ElegirNivel);
function ElegirNivel (e:MouseEvent) {
MovieClip (Root). gotoAndStop (1, "SeleccionNiveles");
Boton100. RemoveEventListener (mouseevent. click, ElegirNivel);
}
And that code redirects the second that I put it in case that is the problem:
Stop ();
Addeventlistener() (mouseevent. click, select);
function Selection (e:MouseEvent) {
if (e. Target == NIVEL1) {
RemoveEventListener (mouseevent. click, select);
MovieClip (Root). gotoAndStop (1, "Nivel1");
}
}
I'm starting on this so your help would make it easier for me to understand.
Thanks for helping me out.
