Button inside a movieclip needs to remove it

hi there. long time reader, first time poster. i have a project i’m working on which is essentially a lot of buttons on a stage, which launch movieclips when clicked. i’ve figured out how to make it work for one of the buttons, but i know there’s a way i can make it work for all the buttons using classes. i’ll get to that later.

at the moment what i’m struggling with is trying to code for a “close” button that is within that movieclip. i’m using addchild to make the clip appear, but i’m not sure where to code the removechild code. lil’ help? i’ll attach my code. (ps, if anyone wants to help me solve the class issue, that’d be nice as well)

//main loads//
function Main () {

//put eventlisteners here//
mission_btn.addEventListener(MouseEvent.CLICK, misspop);

Main ();

var newPopup:Popup = new Popup()


function misspop (e:MouseEvent): void {

newPopup.x = 150;
newPopup.y = 100;

this.close_btn.addEventListener (MouseEvent.CLICK, misshide);


function misshide (e:MouseEvent) : void {