Error #1009 Function with ceveral if statements won't run completely

Hello,

Starting to learn actionscript bit by bit. But im running into a problem i can’t solve atm. Does anyone have a clue what the solution is?

a fla CS3 document with labels and dropzones assignment. Place 10 labels on dropzones in de correct order.
I’ve created a function to check if the labels are on the right dropzones. But the function ( private function controle ():void) runs only the first two if then else constructions. When proceeding to the third i get and error namely;

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at lijstcompleet/controle()
at lijstcompleet/checkTarget()

the file DragDrop.as is the document class. Lijstcompleet.as is a seperate class. I did not post the class because of the length. This is the function causing the problem.

private function controle ():void
{
if(Vlabel1.hitTestObject(getChildByName(“inst_dropzone0”)))
{
getChildByName(“inst_thumbsup0”).alpha = 100;
getChildByName(“inst_thumbsdown0”).alpha = 0;
trace (“controle juist1”)
}
else
{
getChildByName(“inst_thumbsdown0”).alpha = 100;
getChildByName(“inst_thumbsup0”).alpha = 0;
trace (“controle fout1”)
}
if(Vlabel2.hitTestObject(getChildByName(“inst_dropzone1”)))
{
getChildByName(“inst_thumbsup1”).alpha = 100;
getChildByName(“inst_thumbsdown1”).alpha = 0;
trace (“controle juist2”)
}
else
{
getChildByName(“inst_thumbsdown1”).alpha = 100;
getChildByName(“inst_thumbsup1”).alpha = 0;
trace (“controle fout2”)
}
if(Vlabel3.hitTestObject(getChildByName(“inst_dropzone2”)))
{
getChildByName(“inst_thumbsup2”).alpha = 100;
getChildByName(“inst_thumbsdown2”).alpha = 0;
trace (“controle juist3”)
}
else
{
getChildByName(“inst_thumbsdown2”).alpha = 100;
getChildByName(“inst_thumbsup2”).alpha = 0;
trace (“controle fout3”)
}
if(Vlabel4.hitTestObject(getChildByName(“inst_dropzone3”)))
{
getChildByName(“inst_thumbsup3”).alpha = 100;
getChildByName(“inst_thumbsdown3”).alpha = 0;
trace (“controle juist4”)
}
else
{
getChildByName(“inst_thumbsdown3”).alpha = 100;
getChildByName(“inst_thumbsup3”).alpha = 0;
trace (“controle fout4”)
}
}

For more info PM me or see the attached documents. Help would be much appreciated. * i know some things could be done with less code :slight_smile:

kind regards mephisto102