# Calling a function help

**URL:** <https://forum.kirupa.com/t/calling-a-function-help/161509>\
**Category:** flash\
**Created:** [September 4, 2005, 6:43pm UTC](https://forum.kirupa.com/t/calling-a-function-help/161509 "2005-09-04T18:43:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mav88](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mav88/32/1623_2.png) [@mav88](https://forum.kirupa.com/u/mav88)\
**Post date:** [September 4, 2005, 6:43pm UTC](https://forum.kirupa.com/t/calling-a-function-help/161509/1 "2005-09-04T18:43:10Z")

</div>

When the close button in the popup is pressed it wont call the function from the main menu.

Can someone tell me why this function aint been called from the main menu?

**Popup menu**

// calls Var  
this.window\_mc.jpgwindow\_mc.loadMovie(\_level0.jpgVar + “.jpg”);

// calls this function from the main movie  
window\_mc.close\_btn.onRelease = function() {  
\_level0.popUpClose(window\_mc);  
trace(\_level0.jpgVar);  
}

**main menu**

// functions to close pop-up  
function popUpClose(window) {  
unloadMovieNum(2);  
for (var item in buttons) {  
eval(buttons[item]).enabled = true;  
}  
}  
//Button Code  
button1.onRelease = function() {  
\_level0.jpgVar = 3;  
popUpOpen(“landpopUp.swf”);  
};

Now the trace is a test that pulls up the number from the main menu to test that its reading

from the main menu. This works fine and returns the varable so its finding the number from the

\_level0. Its just not calling the popupclose function. Whyyyyyyyy.

This is tearing my hair out!!
