# \[AS\] Help with moving functional stage code into functions

**URL:** <https://forum.kirupa.com/t/as-help-with-moving-functional-stage-code-into-functions/196160>\
**Category:** flash\
**Created:** [August 6, 2006, 4:34am UTC](https://forum.kirupa.com/t/as-help-with-moving-functional-stage-code-into-functions/196160 "2006-08-06T04:34:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jopper](https://avatars.discourse-cdn.com/v4/letter/j/898d66/32.png) [@jopper](https://forum.kirupa.com/u/jopper)\
**Post date:** [August 6, 2006, 4:34am UTC](https://forum.kirupa.com/t/as-help-with-moving-functional-stage-code-into-functions/196160/1 "2006-08-06T04:34:53Z")

</div>

Ok, I can’t get this to work. I’m still confused about functions apparently. I’ll worry about for loops later but I need to get basic functionality first. I’m guessing the problem is with pathing? When mainMenuVisible is called you are on aboutBut (this.menuMC.aboutBut) therefore this.\_parent.mainMenuVisible will take you back to menuMC and in line for (i.e. homeBut.visible). Thanks for the help.

also, the trace doesn’t register and putting the function imputs (i.e. true, false) in “” doesn’t work either.

[SIZE=“1”][COLOR=“Navy”]mainMenuVisible = function (btn1, btn2, btn3, btn4, trc) {  
homeBut.\_visible = btn1;  
aboutBut.\_visible = btn2;  
portBut.\_visible = btn3;  
contBut.\_visible = btn4;  
trace(trc);  
}

this.menuMC.aboutBut.onRelease = function() {  
this.\_parent.mainMenuVisible(true, false, true, true, “test”);  
}[/COLOR][/SIZE]
