i need help fast
i'm an armature and i don't understand this, but when i run the debugger it shows me a line is no different to the lines around it.
the error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at newgame4_fla::MainTimeline/frame2()[newgame4_fla.MainTimeline::frame2:39]
at flash.display::MovieClip/gotoAndStop()
at newgame4_fla::MainTimeline/m1b1()[newgame4_fla.MainTimeline::frame1:9]
the debugger took me here and the arrow was on line 33. (which is in bold):
stop();
var ScoreN = 0;
var ScoreR = 0;
iScoreN.text = ScoreN + " incorrect";
iScoreR.text = ScoreR + " correct";
n1s1.addEventListener(MouseEvent.CLICK, siN);
n2s1.addEventListener(MouseEvent.CLICK, siN);
n3s1.addEventListener(MouseEvent.CLICK, siN);
n1s2.addEventListener(MouseEvent.CLICK, siN);
n2s2.addEventListener(MouseEvent.CLICK, siN);
n3s2.addEventListener(MouseEvent.CLICK, siN);
n1s3.addEventListener(MouseEvent.CLICK, siN);
n2s3.addEventListener(MouseEvent.CLICK, siN);
n3s3.addEventListener(MouseEvent.CLICK, siN);
n1s4.addEventListener(MouseEvent.CLICK, siN);
n2s4.addEventListener(MouseEvent.CLICK, siN);
n3s4.addEventListener(MouseEvent.CLICK, siN);
n1s5.addEventListener(MouseEvent.CLICK, siN);
n2s5.addEventListener(MouseEvent.CLICK, siN);
n3s5.addEventListener(MouseEvent.CLICK, siN);
n1s6.addEventListener(MouseEvent.CLICK, siN);
n2s6.addEventListener(MouseEvent.CLICK, siN);
n3s6.addEventListener(MouseEvent.CLICK, siN);
n1s7.addEventListener(MouseEvent.CLICK, siN);
n2s7.addEventListener(MouseEvent.CLICK, siN);
n3s7.addEventListener(MouseEvent.CLICK, siN);
n1s8.addEventListener(MouseEvent.CLICK, siN);
n2s8.addEventListener(MouseEvent.CLICK, siN);
n3s8.addEventListener(MouseEvent.CLICK, siN);
n1s9.addEventListener(MouseEvent.CLICK, siN);
n2s9.addEventListener(MouseEvent.CLICK, siN);
n3s9.addEventListener(MouseEvent.CLICK, siN);
n1s10.addEventListener(MouseEvent.CLICK, siN);
n2s10.addEventListener(MouseEvent.CLICK, siN);
n3s10.addEventListener(MouseEvent.CLICK, siN);
n1s11.addEventListener(MouseEvent.CLICK, siN);
n2s11.addEventListener(MouseEvent.CLICK, siN);
n3s11.addEventListener(MouseEvent.CLICK, siN);
n1s12.addEventListener(MouseEvent.CLICK, siN);
n2s12.addEventListener(MouseEvent.CLICK, siN);
n3s12.addEventListener(MouseEvent.CLICK, siN);
n1s13.addEventListener(MouseEvent.CLICK, siN);
n2s13.addEventListener(MouseEvent.CLICK, siN);
n3s13.addEventListener(MouseEvent.CLICK, siN);
n1s14.addEventListener(MouseEvent.CLICK, siN);
n2s14.addEventListener(MouseEvent.CLICK, siN);
n3s14.addEventListener(MouseEvent.CLICK, siN);
n1s15.addEventListener(MouseEvent.CLICK, siN);
n2s15.addEventListener(MouseEvent.CLICK, siN);
n3s15.addEventListener(MouseEvent.CLICK, siN);
r1s1.addEventListener(MouseEvent.CLICK, siC);
r1s2.addEventListener(MouseEvent.CLICK, siC);
r1s3.addEventListener(MouseEvent.CLICK, siC);
r1s4.addEventListener(MouseEvent.CLICK, siC);
r1s5.addEventListener(MouseEvent.CLICK, siC);
r1s6.addEventListener(MouseEvent.CLICK, siC);
r1s7.addEventListener(MouseEvent.CLICK, siC);
r1s8.addEventListener(MouseEvent.CLICK, siC);
r1s9.addEventListener(MouseEvent.CLICK, siC);
r1s10.addEventListener(MouseEvent.CLICK, siC);
r1s11.addEventListener(MouseEvent.CLICK, siC);
r1s12.addEventListener(MouseEvent.CLICK, siC);
r1s13.addEventListener(MouseEvent.CLICK, siC);
r1s14.addEventListener(MouseEvent.CLICK, siC);
r1s15.addEventListener(MouseEvent.CLICK, siC);
function siN(event: MouseEvent): void
{
iScoreN.text = ++ScoreN + " incorrect";
}
function siC(event: MouseEvent): void
{
iScoreR.text = ++ScoreR + " correct";
}
this next code is the code for the button which when clicked makes the error come up
stop();
Main_Button1.addEventListener(MouseEvent.CLICK, m1b1);
Main_discovery.addEventListener(MouseEvent.CLICK, m1b1);
function m1b1(event:MouseEvent):void
{
gotoAndStop(2);
}
this code is the only code that relates to the instance mentioned in bold (n1s8)
n1s8.addEventListener(MouseEvent.CLICK, iq8n);
function iq8n(event:MouseEvent):void
{
nextFrame ()
}
screenshot of timeline:
please help thx