Removing movie clip (I've tried everything google has suggested!)

I have a simple mini game where when you touch the screen a firework explodes. It is created using addChild (fw); and accesses a 40 frame movie clip explosion. I need to remove the explosion at frame 40 but for the life of me I can’t figure it out.

I’ve tried various methods of code inside frame 40 - this.parent.removeChild(this); removeChild(this), etc. I’ve tried various methods of code inside the parent including sending an event from the child when it gets to frame 40 that the parent receives and then removes the child from there, etc. But nothing works - the explosion just keeps looping. Sometimes I get a 1009 error, sometimes it just loops and loops.

Is there a good way to do this that will actually work?