Code:
function createDmg(e) {
var duck: enemydmg = new enemydmg;
duck.name = "duck";
addChild(duck);
duck.x = enemy.x
duck.y = enemy.y
duck.flyholder.flydmg.text = hdmg;
}
addEventListener("remove", removeduck);
function removeduck(e) {
trace("trashed");
removeChild(e.target);
}
and on frame 16 of the movie clip I want removed
Code:
this.dispatchEvent(new Event ("remove"));
Pretty much just want the movieClip to remove itself after reaching the end of its frames.
But my duck.addEventListener Isn't receiving a dispatch.
I've tried changing this.dispatchEvent to parent.dispatchEvent, which will allow my addEventListener to hear it, but can't find the target to remove.
Sorry if this doesn't make any sense or is hard to read, Kinda tired.