I have a main.swf that has a menu (mainMenu) and an external swf (ext.swf) that also has a menu (extMenu). When ext.swf is loaded into main.swf and when you CLICK a button from extMenu, I want that mainMenu.visible=false, and by pressing a button you can close the movieClip by clicking a button and the mainMenu.visible=true.
In main.swf, I’ve included:
function menuEstVis(eventObject:MouseEvent) {
mainMenu.visible=true;
trace(“menuVis”);
}
function menuVis() {
addEventListener(MouseEvent.CLICK, menuEstVis);
}
function menuEstInv(eventObject:MouseEvent) {
mainMenu.visible=false;
trace(“menuInv”)
}
function menuInv() {
addEventListener(MouseEvent.CLICK, menuEstInv);
}
And in ext.swf, when you click a button from the extMenu:
function actbtn(e:MouseEvent):void {
var parentObjInv:Object = this.parent.parent as Object;
parentObjInv.menuInv();}
And by clicking the close button:
function closebtn(e:MouseEvent):void {
var parentObjVis:Object = this.parent.parent as Object;
parentObjVis.menuVis();} .
The first time it works (mainMenu.visible=0, and and the trace message is “menuInv” ).And by clicking the close button the mainMenu.visible=true but the trace message is “menuInv” followed by “menuVis”. Apparently, it does the two functions at the same time and the mainMenu does not disappear (mainMenu.visible=false) . How can I fix this.
Thank you