TypeError: Error #1009: Cannot access a property or method of a null object reference. at RECOVER_fyp1_fla::MainTimeline/abc1()
- by user2643323
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at RECOVER_fyp1_fla::MainTimeline/abc1()
Hi, what does this mean? Can anybody figure it out? Thanks.
Code:
swatter.addEventListener(Event.ENTER_FRAME,abc1);
Mouse.hide();
function abc1(e:Event)
{
swatter.x = mouseX;
swatter.y = mouseY;
enter code here
mosq1.y = mosq1.y + 2;
mosq2.y = mosq2.y + 3;
mosq3.y = mosq3.y + 4;
mosq4.y = mosq4.y + 5;
mosq5.y = mosq5.y + 6;
if (mosq1.y > 640)
{
mosq1.y = -50;
}
if (mosq2.y > 640)
{
mosq2.y = -50;
}
if (mosq3.y > 640)
{
mosq3.y = -50;
}
if (mosq4.y > 640)
{
mosq4.y = -50;
}
if (mosq5.y > 640)
{
mosq5.y = -50;
}
if(swatter.hitTestObject(mosq1))
{
//SoundMixer.stopAll();
//three_start_sound1.play();
mosq1.parent.removeChild(mosq1);
}
if(swatter.hitTestObject(mosq2))
{
//SoundMixer.stopAll();
//three_start_sound1.play();
mosq2.parent.removeChild(mosq2);
}
if(swatter.hitTestObject(mosq3))
{
//SoundMixer.stopAll();
//three_start_sound1.play();
mosq3.parent.removeChild(mosq3);
}
if(swatter.hitTestObject(mosq4))
{
//SoundMixer.stopAll();
//three_start_sound1.play();
mosq4.parent.removeChild(mosq4);
}
if(swatter.hitTestObject(mosq5))
{
//SoundMixer.stopAll();
//three_start_sound1.play();
mosq5.parent.removeChild(mosq5);
}
}
enter code here