So I'm trying to figure out how to create popup boxes within popup boxes. I have the first popup box figured out and I tried to just copy the code for the first box and just change the buttons and AS for the second one but I just get an error that says "duplicate function definition" for the loadMC part.

Here's an example of what I'm trying to do and my AS code:



// -- ONLINE WORKFLOW --

//Order Prep Main
var OrderPrepOnlineMenuInstance:OrderPrepOnlineMenu = new OrderPrepOnlineMenu();
var mcOnStage:Boolean=false;
loadOrderPrepOnlineBtn.addEventListener(MouseEvent .CLICK, loadMC);
OrderPrepOnlineMenuInstance.OrderPrepOnlineClose.b uttonMode=true; OrderPrepOnlineMenuInstance.OrderPrepOnlineClose.a ddEventListener(MouseEvent.CLICK, removeMC);

function loadMC(e:MouseEvent):void {
addChild(OrderPrepOnlineMenuInstance);
OrderPrepOnlineMenuInstance.x = 465;
OrderPrepOnlineMenuInstance.y = 230;
mcOnStage=true;
}

function removeMC(e:MouseEvent):void {
if (mcOnStage ) {
removeChild(OrderPrepOnlineMenuInstance);
mcOnStage=false;
}
}

//Order Prep - Inventory Grids
var InventoryGridsOnlineDescBoxInstance:InventoryGrids OnlineDescBox = new InventoryGridsOnlineDescBox();
loadIventoryGridsOnlineBtn.addEventListener(MouseE vent.CLICK, loadMC);
InventoryGridsOnlineDescBoxInstance.InventoryGrids Close.buttonMode=true; InventoryGridsOnlineDescBox.InventoryGridsClose.ad dEventListener(MouseEvent.CLICK, removeMC);

function loadMC(e:MouseEvent):void {
addChild(InventoryGridsOnlineDescBoxInstance);
InventoryGridsOnlineDescBoxInstance.x = 465;
InventoryGridsOnlineDescBoxInstance.y = 230;
}

function removeInventoryGridsMC(e:MouseEvent):void {
if (mcOnStage ) {
removeChild(InventoryGridsOnlineDescBoxInstance);
}
}