I need help with something with Actionscript for school. It's a simple catching game. It keeps saying that my displayed object must be a caller of the child which it should be and it kinda works but I'm not sure how to fix the problem where my bunny object falls through my point character and gives me an error when it collides with the point character and when it hits the floor when it's not caught. The child should exist but I guess it doesn't. I don't know what to do. The commented stuff was stuff I tested on another file and transferred it over to see what it would do.
//Block = Asuka
//Ball = Bunny
//Ballz = Bunz
//Bunny is linked in library
import flash.events.Event;
var intervalBunny = setInterval(addBunny, 1000);
var bunz: Array = [];
function addBunny() {
var bunny: Bunny = new Bunny();
bunny.x = Math.ceil(Math.random() * 500);
bunny.y = -50;
addChild(bunny);
bunz.push(bunny);
bunny.addEventListener(Event.ENTER_FRAME, dropBunny);
}
function dropBunny(e: Event) {
var b: Bunny = Bunny(e.target);
b.y += 10;
if (b.y > 400) {
eliminatebunz(b);
}
}
stage.addEventListener(Event.ENTER_FRAME, moveAsuka);
function moveAsuka(e: Event) {
Asuka.x = mouseX;
for (var i: int = 0; i < bunz.length; i++) {
trace(i);
if (Asuka.hitTestObject(bunz[i])) {
eliminatebunz(bunz[i]);
//points
}
}
}
function eliminatebunz(p) {
p.removeEventListener(Event.ENTER_FRAME, dropBunny);
removeChild(p);
}
Here's the code Any help on how to fix it would be GREATLY appreciated, especially since I am not a big coder and I'm more of an artist/illustrator