Getting an error: #2007 Parameter hitTestObject must be non-null
Essentially the game is not registering a hit. See my Bomb.as file below
Thanks for any help!
package {
import flash.display.*;
import flash.events.*;
import Icons;
public class Bomb extends MovieClip {
// NEW CODE
public var speed:Number = 10;
public var rootTimeline:MovieClip;
public function Bomb(parentTimeline:MovieClip, parentIcons:Icons)
{
// NEW CODE
rootTimeline = parentTimeline;
trace(parentIcons.x);
this.x = parentIcons.x;
this.y = parentIcons.y;
addEventListener(Event.ENTER_FRAME, moveBomb);
}
public function moveBomb(e:Event)
{
// NEW CODE dropping the bomb and some time is added - same idea as Pointer
this.y = this.y + speed;
if(this.y > 500){
this.removeEventListener(Event.ENTER_FRAME, moveBomb);
}[COLOR="Red"]else if(this.hitTestObject(rootTimeline.playermouse) && rootTimeline.playermouse.currentFrame == 1){
rootTimeline.registerHit();
this.y = 510;[/COLOR]
}
}
}
}
// had this 1: }else if(this.hitTestObject(rootTimeline.playermouse) && rootTimeline.playermouse.currentFrame == 1){
// had this 2: }else if(rootTimeline.playermouse && this.hitTestObject(rootTimeline.playermouse) && rootTimeline.playermouse.currentFrame == 10){